home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d2 / pwr14.arc / POWERBAT.DOC < prev    next >
Encoding:
Text File  |  1990-09-10  |  116.9 KB  |  2,491 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                                         PowerBatch
  22.                                        Version 1.4
  23.  
  24.  
  25.  
  26.                               COMPUTING SYSTEMS DESIGN, INC.
  27.                                      P.O. Box 566484
  28.                                   Atlanta, GA 30356-6009
  29.  
  30.  
  31.                                    _______
  32.                               ____|__     |               (tm)
  33.                            --|       |    |-------------------
  34.                              |   ____|__  |  Association of
  35.                              |  |       |_|  Shareware
  36.                              |__|   o   |    Professionals
  37.                            -----|   |   |---------------------
  38.                                 |___|___|    MEMBER
  39.  
  40.  
  41.             CSD,  Inc.   is  a   member  of   The  Association  of   Shareware
  42.             Professionals and subscribes to  all the policies and standards of
  43.             this organization.
  44.  
  45.                            Copyright (c) 1989,1990 by CSD, Inc.
  46.                               All Rights Reserved Worldwide
  47.  
  48.                      This documentation was produced on July 26, 1990
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.                                     Table Of Contents
  57.  
  58.  
  59.            Introduction . . . . . . . . . . . . . . . . . . . . . . . . .    1
  60.  
  61.            Registration Fees And What You Get . . . . . . . . . . . . . .    3
  62.  
  63.            Software Support . . . . . . . . . . . . . . . . . . . . . . .    4
  64.  
  65.            Concept Of Operation . . . . . . . . . . . . . . . . . . . . .    5
  66.  
  67.            Installation . . . . . . . . . . . . . . . . . . . . . . . . .    7
  68.  
  69.            Constructing A PowerBatch Source File  . . . . . . . . . . . .    9
  70.  
  71.            PowerBatch Commands  . . . . . . . . . . . . . . . . . . . . .   10
  72.  
  73.            Command Summary  . . . . . . . . . . . . . . . . . . . . . . .   30
  74.  
  75.            Compilation Errors . . . . . . . . . . . . . . . . . . . . . .   31
  76.  
  77.            Removing PowerBatch From Your System . . . . . . . . . . . . .   33
  78.  
  79.            Examples . . . . . . . . . . . . . . . . . . . . . . . . . . .   34
  80.               DEMO1 . . . . . . . . . . . . . . . . . . . . . . . . . . .   34
  81.               MOVE1 . . . . . . . . . . . . . . . . . . . . . . . . . . .   40
  82.               MOVE2 . . . . . . . . . . . . . . . . . . . . . . . . . . .   41
  83.               MENU1 . . . . . . . . . . . . . . . . . . . . . . . . . . .   42
  84.               BOXDEMO2  . . . . . . . . . . . . . . . . . . . . . . . . .   43
  85.  
  86.            Index  . . . . . . . . . . . . . . . . . . . . . . . . . . . .   45
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.             Page 1                      PowerBatch                      Page 1
  95.  
  96.                                        Introduction
  97.  
  98.             PowerBatch  is a  Shareware product.  Shareware is  a distribution
  99.             method,  not  a  type of  software.  With  Shareware you  get  the
  100.             ultimate  money-back guarantee...if you don't use the product, you
  101.             don't pay for it.
  102.  
  103.             Shareware  is not  free  software. Copyright  laws  apply  to both
  104.             Shareware  and  commercial  software,  and  the  copyright  holder
  105.             retains  all rights,  with a few specific  exceptions as stated in
  106.             this  document.  Shareware authors  are accomplished  programmers,
  107.             just like commercial authors, and the  programs are of  comparable
  108.             quality.  (In  both cases,  you will  find good  programs and  bad
  109.             ones!)  The main difference is  in the method of distribution. The
  110.             author specifically grants  the right  to copy and distribute  the
  111.             EVALUATION  VERSION  of  the software  to  anyone  as long  as  no
  112.             remuneration  is  received for  the distribution  of the  software
  113.             unless permission is granted in writing by the author.
  114.  
  115.             Shareware  distribution  gives  users a  chance  to  try  software
  116.             before  buying it.  If you  try a  Shareware program  and continue
  117.             using  it,  you are  expected to  register the  software with  the
  118.             author.  With registration, you will receive the latest version of
  119.             the  software  without the  evaluation titles  and messages.  With
  120.             shareware you  are able to try the software on  your computer with
  121.             your  own set  of peripherals,  the only  way to  know if  it will
  122.             function  in your own  environment. After deciding that PowerBatch
  123.             is a  software product that  you will  use, then and only  then do
  124.             you  pay for it.  The ultimate trust from the  author! When you do
  125.             pay for  the software,  you pay  only for  the  software, not  for
  126.             advertisement  for the software which can cost many times what the
  127.             software actually costs.
  128.  
  129.             CSD,  Inc.  is   a  member   of  the   Association  of   Shareware
  130.             Professionals  (ASP).   ASP wants to make  sure that the shareware
  131.             principle works for you. If you are unable to  resolve a shareware
  132.             -related  problem  with  an ASP  member by  contacting  the member
  133.             directly,  ASP may be able to help. The ASP Ombudsman can help you
  134.             resolve a  dispute or  problem with  an ASP  member, but does  not
  135.             provide  technical support for  members' products. Please write to
  136.             the  ASP Ombudsman at P.O.  Box 5786, Bellevue, WA 98006 or send a
  137.             Compuserve message via easyplex to ASP Ombudsman 70007,3536.
  138.  
  139.             While CSD has  no immediate plans to move, businesses do move from
  140.             time  to time.  Since shareware tends  to remain on  some bulletin
  141.             boards without  update  for many  years, if  the shareware  author
  142.             does  move, you may experience a problem in contacting the author.
  143.             You may also contact ASP  to learn of the  current address of  any
  144.             ASP member if you experience this problem.
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.             Page 2                      PowerBatch                      Page 2
  153.  
  154.             Trademarks
  155.             ----------
  156.  
  157.             PowerBatch is a trademark of Computing Systems Design, Inc.
  158.             MS-DOS is a trademark of Microsoft Corporation.
  159.             IBM and PC-DOS are trademarks of IBM Corporation.
  160.             ASP, Association of Shareware Professionals,  and the ASP logo are
  161.             registered    trademarks   of   the   Association   of   Shareware
  162.             Professionals.
  163.  
  164.             Liscense Agreement
  165.             ------------------
  166.  
  167.             By  installing  PowerBatch  on  your  system,  you  indicate  your
  168.             agreement  to the  following terms and  conditions. If you  do not
  169.             agree  to these  conditions, you  should not  install and  use the
  170.             PowerBatch   System.  POWERMAK,  SMLMODEL,  and  the  accompanying
  171.             supporting  programs  and   documentation  will   be  collectively
  172.             referred to as PowerBatch.
  173.  
  174.             Users  of  PowerBatch must  accept  this disclaimer  of  warranty:
  175.             "PowerBatch is supplied as is.  The author disclaims all
  176.             warranties,  expressed or  implied, including, without limitation,
  177.             the warranties of  merchantability and of fitness for any purpose.
  178.             The   author  assumes   no  liability   for  damages,   direct  or
  179.             consequential, which may result from the use of PowerBatch."
  180.  
  181.             PowerBatch  is a "shareware program"  and is provided at no charge
  182.             to the user  for evaluation.   Feel free  to share the  EVALUATION
  183.             COPY with your friends, but please do not give  it away altered or
  184.             as  part of  another  system.   The  essence  of  "user-supported"
  185.             software  is  to  provide personal  computer  users  with  quality
  186.             software  without high  prices, and  yet to  provide incentive for
  187.             programmers  to continue  to develop  new products.   If  you find
  188.             this  program useful  and find that  you are using  PowerBatch and
  189.             continue to  use PowerBatch after a 30 day trial  period, you must
  190.             make  a  registration payment  to Computing  Systems Design,  Inc.
  191.             (CSD, Inc.).   The registration fee  will license one copy for use
  192.             on  any  one computer  at  any one  time.    You  must treat  this
  193.             software just like a book.   An example is  that this software may
  194.             be used  by any number of people and may be  freely moved from one
  195.             computer  location to another, so  long as there is no possibility
  196.             of  it  being  used at  one  location  while it's  being  used  at
  197.             another. Just as  a book cannot  be read by two  different persons
  198.             at the same time.
  199.  
  200.             Commercial  users (every user except personal users) of PowerBatch
  201.             must  register and  pay for their  copies of PowerBatch  within 30
  202.             days  of first  use or their  license is withdrawn.   Site-License
  203.             arrangements  may be made  by contacting Computing Systems Design,
  204.             Inc. (CSD, Inc.).
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.             Page 3                      PowerBatch                      Page 3
  213.  
  214.             Anyone  distributing PowerBatch for  any kind of remuneration must
  215.             first  contact Computing Systems  Design, Inc.  (CSD, Inc.) at the
  216.             address  on the  title page for  authorization. This authorization
  217.             will  be automatically  granted to distributors  recognized by the
  218.             (ASP)  as adhering  to its guidelines  for shareware distributors,
  219.             and such distributors  may begin  offering PowerBatch  immediately
  220.             (However Computing Systems Design, Inc.  (CSD, Inc.) must still be
  221.             advised  so that  the distributor can be  kept up-to-date with the
  222.             latest version of PowerBatch.).
  223.  
  224.             You  are encouraged to pass an EVALUATION COPY of PowerBatch along
  225.             to  your  friends  for  evaluation.    Please  encourage  them  to
  226.             register their  copy if  they  find  that they  can use  it.   All
  227.             registered  users will  receive a  copy of  the latest  version of
  228.             PowerBatch.  Distribution of registered  copies of PowerBatch is a
  229.             violation of copyright laws.
  230.  
  231.             To register your copy of PowerBatch, print the file  REGISTER.FRM,
  232.             complete  this form, and send  along with your registration fee to
  233.             CSD,  Inc.  You will  receive the  latest version  of the  program
  234.             along  with the latest documentation. The fully registered version
  235.             of  the program  removes all references  to evaluation. Registered
  236.             users will receive notice of  all updates made to  the program and
  237.             these  updates will be supplied  to registered users for a nominal
  238.             charge.  Every effort will be made to supply updates to registered
  239.             users at the lowest possible cost.
  240.  
  241.             If  you  need  to  submit an  invoice  to  your  accounts  payable
  242.             department,   print  the   form  INVOICE.FRM   and  fill   in  the
  243.             appropriate blanks.
  244.  
  245.             Registration Fees And What You Get
  246.             The   evaluation  version  of  PowerBatch  contains  100%  of  the
  247.             capabilities  of  the  registered  version.   Those  who  register
  248.             PowerBatch will  receive the latest  release of  the software  and
  249.             documentation  and will  receive update  offers in  the mail  at a
  250.             minimal cost  as they  become available.  CSD maintains copies  of
  251.             innovative batch  files submitted  by users  and will  include the
  252.             best of these batch files along with the registered software.
  253.  
  254.             The  registration fee  for PowerBatch is US  $30. Price is subject
  255.             to change without  notice but will  be guaranteed through December
  256.             1990. If  payment is by check, these  funds must be  drawn on a US
  257.             bank.  Unfortunately the  processing of  non-US checks  can  be as
  258.             much as $20 and we cannot afford this type  of transaction. We are
  259.             continually  looking   for  innovative   ways   to  serve   non-US
  260.             customers.
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.             Page 4                      PowerBatch                      Page 4
  269.  
  270.             Software Support
  271.             ----------------
  272.  
  273.             Support for PowerBatch  may be obtained by contacting CSD,Inc.  on
  274.             Compuserve  using Compuserve Mail (EasyPlex). Address inquiries to
  275.             Compuserve  ID 72701,155. If you  are not a Compuserve member, you
  276.             may obtain support by writing to:
  277.  
  278.                               Computing Systems Design, Inc.
  279.                                      P.O. Box 566484
  280.                                   Atlanta, GA 30356-6009
  281.  
  282.             If  you feel  you have a  question that needs  immediate attention
  283.             and  you are a registered  user, CSD's office hours  are 8AM until
  284.             5PM CST. We will  be happy to discuss any problems or  suggestions
  285.             for PowerBatch but time does  not permit us to help you debug your
  286.             PowerBatch source problems.
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.             Page 5                      PowerBatch                      Page 5
  295.  
  296.                                    Concept Of Operation
  297.  
  298.             PowerBatch  is a  compiler for batch file  "type" commands. At the
  299.             present  time there  are 35  PowerBatch commands  which will  work
  300.             only in  a  PowerBatch source  file (they  will not  execute in  a
  301.             standard  DOS batch  file). Any  valid executable  command (.EXE &
  302.             .COM) as  well as  any of  the  DOS intrinsic  commands are  valid
  303.             within  a PowerBatch  source file  and will  be  "compiled". These
  304.             .EXE,  .COM  and DOS  intrinsic commands  will be  executed via  a
  305.             shell  and  the PowerBatch  .EXE program  will continue  execution
  306.             with  the next  compiled statement following  the shelled command.
  307.             There   are   two   main   modules   supplied   with   PowerBatch;
  308.             1)POWERMAK.EXE  and  2)SMLMODEL.MDL. PowerMak  reads,  parses  the
  309.             source  file,  and compiles  the source  extracting routines  from
  310.             SmlModel.  The result  is a  completely standalone  .EXE file that
  311.             executes  without  SmlModel or  PowerMak.  The increase  in  speed
  312.             comes from  the use  of  the PowerBatch  commands as  the DOS  and
  313.             executable modules will  not be executed any faster. Most  notable
  314.             is  the  increase  in  speed  dealing  with  screen  writes.  Many
  315.             capabilities  are provided in  PowerBatch commands that simply are
  316.             not available with standard DOS commands.
  317.  
  318.                                     Why Use PowerBatch
  319.  
  320.             There  are  four major  reasons  for  using a  compiled PowerBatch
  321.             program:
  322.                  1)  The  resulting  program  will  almost  certainly  execute
  323.                     considerably  faster.   While  it  might  be  possible  to
  324.                     construct  a compiled  PowerBatch  program that  does  not
  325.                     execute faster, it would have to  consist entirely of pre-
  326.                     existing executable modules.
  327.                  2) PowerBatch  commands provide  a  considerable increase  in
  328.                     flexibility and power over conventional batch files.
  329.                  3) PowerBatch  programs  cannot  be  changed  without  making
  330.                     machine   code   modifications.  This   means   additional
  331.                     security for distributed batch files.
  332.                  4)  PowerBatch  programs  can  be  created  quickly  for  the
  333.                     PowerBatch command set is a very high level language.
  334.  
  335.             PowerBatch commands fall into 5 classes of commands;
  336.               1) Commands which  provide systems  information. These  commands
  337.                  provide  the current  color settings,  the current  date, the
  338.                  current  time, check  for  the  existance  of a  valid  drive
  339.                  letter,  and commands  which  check for  the  existance  of a
  340.                  directory or a file.
  341.               2)  Commands  which  control  the  flow of  the  batch  program.
  342.                  Execute  different  portions of  the batch  program based  on
  343.                  existance  or non-existance of directories  or files. Compare
  344.                  the contents  of one  variable with the  contents of  another
  345.                  variable  or a constant and execute different portions of the
  346.                  batch program based on the results of the compare.
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.             Page 6                      PowerBatch                      Page 6
  355.  
  356.               3)  Commands  which  control the  way  text  is printed  on  the
  357.                  screen.  Change any portion of the screen to any valid screen
  358.                  color,  cause a message to  blink on the screen, or highlight
  359.                  a message in reverse video.
  360.               4)  Commands which provide  string manipulation. Change a string
  361.                  to all upper  case characters, or  all lower case characters.
  362.                  Extract  a  portion  of a  string  such  as the  first  three
  363.                  characters or the last  four characters. Build  a new  string
  364.                  from  two  existing  strings  by  concatenation  of  the  two
  365.                  strings.
  366.               5)  Commands which  deal with screen writing  and input from the
  367.                  keyboard.   These  commands   are  the  main   power  in  the
  368.                  PowerBatch system.  Directly  address  any  position  on  the
  369.                  screen and move the cursor to that position to  read or write
  370.                  text. Automatically center  a message  or title on any  line.
  371.                  Draw boxes  around portions of  the screen  to enhance screen
  372.                  appearance. Read  a single key  from the  keyboard, read  the
  373.                  response to a query that only  accepts a yes or  no response,
  374.                  read  a  string  of  characters  from  the  keyboard  with  a
  375.                  specified  maximum length,  and read  keys from  the keyboard
  376.                  automatically changing the characters to upper case.
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.             Page 7                      PowerBatch                      Page 7
  385.  
  386.                                        Installation
  387.  
  388.             Installation is  accomplished by executing  the PBInstal  program.
  389.             It  seemed only  fitting that this  install program be  a compiled
  390.             PowerBatch  program. I  believe this  to be  the epitome  of self-
  391.             installing  software.  The  two  main   modules  POWERMAK.EXE  and
  392.             SMLMODEL.MDL must  be located  in the  DOS  path to  allow you  to
  393.             compile  PowerBatch programs  from any  directory on  your system.
  394.             PowerBatch  may be run  on a system  as small  as a  single floppy
  395.             drive system with 128K. There  will be some limit to the number of
  396.             source statements that  may be compiled on  a system this small as
  397.             memory  is  dynamically  allocated as  compilation  progresses.  A
  398.             source  file of  several hundred statements  can be compiled  on a
  399.             small machine.
  400.  
  401.             PowerBatch may  be installed  from either  drive A, B,  or a  hard
  402.             drive.
  403.  
  404.             If the PowerBatch source is  on a floppy disk, you may execute the
  405.             install procedure by:
  406.  
  407.               1) If your  current drive  is the  A: (or  B:) drive then  enter
  408.                  PBInstal <enter>.
  409.               2)  If you current  drive is other  than A:  (or B:)  then enter
  410.                  A:PBInstal <enter> (or B:PBInstal <enter>).
  411.  
  412.             If you  are installing PowerBatch from  a fixed disk drive such as
  413.             C:, then  make the directory  which contains the PowerBatch source
  414.             the  current  default  directory.  For  example  if  you have  the
  415.             PowerBatch  source in  a directory  named C:\TEMP,  then at  a DOS
  416.             prompt enter
  417.  
  418.             CD \TEMP <enter>
  419.             PBInstal <enter>
  420.  
  421.             You  will  first  be  asked to  enter  the  directory  name  which
  422.             contains the PowerBatch source. Next you will be asked to enter  a
  423.             directory name  on your  DOS  path where  the PowerBatch  compiler
  424.             will be placed.  POWERMAK.EXE and SMLMODEL.MDL  will be  placed in
  425.             this  directory. Before  you begin the  installation process, know
  426.             the name of a directory which is on the DOS  search path where you
  427.             will  place these  two files. The  install program will  not allow
  428.             you to  place the  compiler  in  a directory  that is  not on  the
  429.             search path.
  430.  
  431.             Now  you will be asked  to enter a  directory name where you would
  432.             like  the documentation,  informational, and  example files  to be
  433.             placed. This directory does not  have to be on  your DOS path.  If
  434.             this  directory  does  not  exist,  PowerBatch  will  create  this
  435.             directory   for  you   if  you   desire.  The   documentation  and
  436.             information files will be placed in this directory.
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.             Page 8                      PowerBatch                      Page 8
  445.  
  446.             The  first  time that  you run  the PowerBatch  compiler, it  will
  447.             customize  itself for the computer  on which you are running. This
  448.             process takes about  a minute and  will not run  again. Take  this
  449.             opportunity  to learn about the shareware distribution process and
  450.             how to  register PowerBatch if  after taking it for  a test drive,
  451.             you  feel  you  would  like  to  add  it  to  your  collection  of
  452.             utilities.
  453.  
  454.             We  at CSD  would like  to share  innovative batch  file creations
  455.             with  our customer  base. If  you have  created such  a PowerBatch
  456.             program  and would  like to share it  with other PowerBatch users,
  457.             send it to us and if  we agree with you we  will include it on our
  458.             registration  disk  to  our customers.  You  may  mail us  a  disk
  459.             containing   the  PowerBatch  source   or  you  may  send  it  via
  460.             CompuServe EasyPlex.
  461.  
  462.             Our address is:
  463.               CSD, Inc.
  464.               P.O. Box 566484
  465.               Atlanta, GA 30356-6009
  466.  
  467.             Our CompuServe ID is 72701,155.
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.             Page 9                      PowerBatch                      Page 9
  476.  
  477.                           Constructing A PowerBatch Source File
  478.  
  479.             Use  your favorite  text editor to  create a printable  ascii file
  480.             containing   PowerBatch  source   commands  and   DOS   executable
  481.             commands.  A printable ascii file  is one that may be typed to the
  482.             screen  (ie type  myfile.pwr <enter>)  and the  results printed on
  483.             the  screen contain  only the  file  contents. Most  files created
  484.             with  a word  processor are not  printable ascii files  unless you
  485.             specify an ascii file output option.
  486.  
  487.             Compile  your  source  statements  to  create  a  .EXE  executable
  488.             module. This is done using the POWERMAK compiler. The syntax is:
  489.  
  490.                  POWERMAK MyFile [OutFile] [+M]
  491.  
  492.             PowerMake assumes  the extension of the  input file to be .PWR (ie
  493.             MYFILE.PWR)  and will  create an output  file of MYFILE.EXE  if no
  494.             OutFile  parameter is specified. The  input source file may be any
  495.             DOS name  of your  choice(including the  extension). You may  also
  496.             specify an output file name of your choice but the extension  will
  497.             always  be .EXE.  If you do not  enter the input file  name on the
  498.             command line, the  program will prompt you  for the name. You must
  499.             at this time enter the complete name including the extension.
  500.  
  501.             If you wish  to generate a  list of all  literals, variables,  and
  502.             labels  used in your PowerBatch  program, add +M to the end of the
  503.             command  line.   This  variable  map  will   be  written  to   the
  504.             POWERBAT.ERR file.
  505.  
  506.             If the compiler finds no compilation  errors, the compiled version
  507.             of  your  source file  will be  generated. For  an explanation  of
  508.             compilation   errors,  see   the  section   entitled  "Compilation
  509.             Errors".  Compilation errors  appear  on your  screen as  they are
  510.             encountered and they  are written  to a  file named  POWERBAT.ERR.
  511.             The  entire  source  code  is scanned  each  time  you  compile  a
  512.             PowerBatch  program (ie  the compiler does not  stop when an error
  513.             is found, but attempts to identify all errors on each pass).  This
  514.             means  that  some errors  will be  the result  of previous  errors
  515.             found in the source.
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.             Page 10                     PowerBatch                     Page 10
  524.  
  525.                                    PowerBatch Commands
  526.  
  527.             Commands,  Variable  Names, and  Labels  are not  case  sensitive.
  528.             Everything  on the command source  line is converted to upper case
  529.             except  a literal  which is enclosed within  quotes. Either single
  530.             quotes(')  or double  quotes(") may be  used to denote  a literal.
  531.             Literals   which  are  numeric  such  as  color  values,  variable
  532.             lengths,  etc. should not be enclosed in quotes. The compiler does
  533.             evaluate  each  literal  (both alpha  and  numeric)  in  the  same
  534.             manner. The  evaluation process is  1) remove leading and trailing
  535.             quotes if any,  2) attempt  to convert literal  to numeric, 3)  if
  536.             numeric conversion  is successful,  consider it  a  number, 4)  if
  537.             numeric  conversion is  unsuccessful, consider  it  alpha numeric.
  538.             This  means that internally  an operand of 3 and  "3" will both be
  539.             numeric.
  540.  
  541.             A  semicolon which  is not enclosed within  quotes or a  part of a
  542.             command is used to denote a  comment. Semicolons which are part of
  543.             a command must not be  preceded by a space.  A comment begins with
  544.             a  semicolon which follows a space not within quotes. Comments may
  545.             appear  anywhere  on the  command  line,  but  everything after  a
  546.             semicolon on a  command line  is ignored. A  comment may begin  in
  547.             column 1 by placing the  semicolon in column 1.  The following are
  548.             NOT comments:
  549.  
  550.               path=d:\;c:\util;c:\wp
  551.               path   "d:\;c:\util;c:\wp"
  552.               WriteLine   "Punctuation may be used within quotes;"
  553.  
  554.             These ARE comments:
  555.  
  556.               Variable    ColorSave,3 ;save the original color
  557.               SetVar      Msg, ErrMsg ;set Msg to "Invalid input; re-enter"
  558.  
  559.             The starting location on the command line  of the command and  the
  560.             operands is  not important and tabs and spaces may  be freely used
  561.             for readability.
  562.  
  563.             Variable names and command  labels may be any length in the source
  564.             command   but  are  significant   only  through  the  first  eight
  565.             positions.
  566.  
  567.             Variables, Literals, and Labels
  568.  
  569.             A variable is a location  in memory that you  allocate and give  a
  570.             name and a maximum length.  Anytime you refer to the "name" of the
  571.             variable, you are referencing  the memory locations  set aside for
  572.             this  variable. Variable names give  you an easy way to manipulate
  573.             data  internally within  the computer. The  following are examples
  574.             of variables:
  575.               Variable    CharIn,1
  576.                     This  variable  gives  the name  "CharIn"  to  one  memory
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.             Page 11                     PowerBatch                     Page 11
  585.  
  586.                     position. It  will be used to hold one character responses
  587.                     from the keyboard by the user. 
  588.  
  589.               Variable    PBDir,79
  590.                     This  variable appears  in the PBInstal  program and holds
  591.                     the  name of  the directory where  the PowerBatch compiler
  592.                     will  be placed.  It is composed  of the drive  letter and
  593.                     directory   entered  by  the   user  in  response  to  two
  594.                     questions during the installation process.
  595.  
  596.               Variable    CompName,35,"The ABC Company"
  597.                     This  variable reserves  35 positions in  memory and gives
  598.                     these  locations   the  name   CompName.  The   PowerBatch
  599.                     compiler  also places the  initial value "The ABC Company"
  600.                     in  the first  15 positions of the  variable. The value of
  601.                     this variable  may be changed  by later  processing in the
  602.                     program.
  603.  
  604.               Variable    MsgClear,20,"                    "
  605.                     This  variable contains  20 spaces and  is named MsgClear.
  606.                     It  will be  used to "clear"  or overwrite with  spaces an
  607.                     error message in  your program. Once you have displayed  a
  608.                     message  to the user, it should be cleared as you continue
  609.                     with  the  program.  This  is  done  by  overwriting  with
  610.                     spaces.  Having  a variable  with  the correct  number  of
  611.                     spaces makes this task easier.
  612.  
  613.             There  are two  predefined variables  in each  PowerBatch program;
  614.             ERRORLEVEL  and DOSERROR. The ErrorLevel variable and the DOSError
  615.             variable are updated  each time an  external command  is executed.
  616.             If  you execute a program  which sets an  error code on exit, this
  617.             error  code  will  be in  ERRORLEVEL.  The  use of  ERRORLEVEL  in
  618.             PowerBatch  is equivalent  to the use of  ERRORLEVEL in a standard
  619.             DOS batch  file. If you  execute an  external command(program) and
  620.             that  command does  not terminate normally,  the variable DOSERROR
  621.             will  be set  to  the DOS  error code  assigned  by  the operating
  622.             system.  It  is  good practice  to examine  the  DOSERROR variable
  623.             after executing an external command.
  624.  
  625.             Literals are  very much like variables  which have a  value but no
  626.             name.  Literals are  used in PowerBatch commands  when you wish to
  627.             pass an actual  value to the command  instead of a variable.  Note
  628.             in  the following  examples that literals  containing numbers only
  629.             are  not  enclosed  in quotes  and  literals  containing  any non-
  630.             numeric  characters are  enclosed  in  quotes. If  you  specify  a
  631.             number  as a  literal either convention is  acceptable (3 or "3").
  632.             If  you specify  alphabetic characters,  the quotes  are required.
  633.             For readability, and  ease of entry,  numeric literals  usually do
  634.             not contains quotes. Examine the following examples of literals:
  635.  
  636.               Center      "Installation Program",1
  637.                     This  command   will  center  the  literal   "Installation
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.             Page 12                     PowerBatch                     Page 12
  646.  
  647.                     Program" on  line 1 of  the screen. The text "Installation
  648.                     Program"  must  appear somewhere  in  the program  and  it
  649.                     appears as a literal. It will  occupy memory positions and
  650.                     will have a value but you may not reference this value  by
  651.                     name.  By instructing the  compiler to write this literal,
  652.                     the  compiler automatically  creates the  memory locations
  653.                     and  initial value but gives  it no name.  The 1 is also a
  654.                     literal in this command.
  655.  
  656.               WriteAt     12,3,Msg1
  657.                     There are  two literals  in this  command. The  numbers 12
  658.                     and  3 are both created  as literals. In this command they
  659.                     specify the column and row location where the string  Msg1
  660.                     will  be written.  Again, the compiler  creates the memory
  661.                     locations and values  for these literals, but no names. If
  662.                     you  were  to  write  another  command  such  as  the Beep
  663.                     command  which specifies that the system speaker will beep
  664.                     at  a certain  frequency for  3 times,  the compiler  will
  665.                     find  the  previously defined  literal  "3" and  use  this
  666.                     value instead of creating another literal.
  667.  
  668.               Beep        ErrTone,8,3
  669.                     This  is  the  Beep command  referenced  in  the  previous
  670.                     example. The beep  command will cause the speaker to sound
  671.                     at  a  frequency of  ErrTone for  .8 second  and repeat  3
  672.                     times.  The "3" literal will use the  same memory location
  673.                     reference  as  the WriteAt  command used  in the  previous
  674.                     command (ie another literal will not be created).
  675.  
  676.             Labels  are names of a particular place in your PowerBatch program
  677.             that  you will  go to without executing  the previous command. You
  678.             go  directly to this location in the program from another location
  679.             in  the program based on a decision you have  made in the program.
  680.             Examples will help explain:
  681.  
  682.               ReadYN      "Do you wish to continue [Y/N] ",InChar
  683.               Compare     InChar,"Y",,,GetDrive
  684.               Halt        999
  685.               ;end the program if user enters "N"
  686.               Label       GetDrive
  687.                     This  group of  commands writes the message  on the screen
  688.                     and asks  the user  to input either  Y or  N (the  command
  689.                     will  only accept these  two characters). A comparision is
  690.                     then  made to  a literal "Y" and  the compare command will
  691.                     jump  to the  location in the program  named GetDrive if a
  692.                     "Y"  was entered  or will execute the  next command if "N"
  693.                     was entered.
  694.  
  695.               GoTo        NextCmd
  696.               .
  697.               .
  698.               .
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.             Page 13                     PowerBatch                     Page 13
  707.  
  708.               Label       NextCmd
  709.                     In  this most straightforward  use of  the label, the user
  710.                     simply  uses the GoTo command and jumps unconditionally to
  711.                     another point in the program.
  712.  
  713.             External  commands  are entered  just as  PowerBatch commands  are
  714.             entered.  If you  enter an external command  and this command uses
  715.             command line parameters, these parameters may be  passed as either
  716.             variables  or literals.  Remember that  if  the parameter  is  not
  717.             numeric, it must be enclosed in quotes or it will be  treated as a
  718.             variable. Examples:
  719.  
  720.               Variable    InChar,1
  721.               ReadYN      "Do you wish a directory ",InChar
  722.               Compare     InChar,"Y",NextSec,NextSec
  723.               DIR         "/W"
  724.  
  725.               Variable    PgmName,12
  726.               Write       "Enter the name of the program to compile "
  727.               ReadStr     PgmName
  728.               TPC         PgmName, "/ddebug"
  729.  
  730.             This  third example of external  commands show the  use of the two
  731.             predefined  variables,   ERRORLEVEL   and   DOSERROR.  After   the
  732.             execution  of  "TestPgm",  we  examine  DOSError  to  find  if the
  733.             program  executed OK (Possibly there  was not enough memory or the
  734.             program  could not  be found on  the DOS path).  After determining
  735.             that the  program executed  OK, we  examine the  exit code set  by
  736.             "TestPgm"  to determine  the flow  of the  remainder of  our batch
  737.             file. This exit code will be found in the variable ERRORLEVEL.
  738.  
  739.               Variable    MsgLine,80
  740.               .
  741.               .
  742.               TestPgm     "Parm1 Parm2"
  743.               Compare     DOSError,0,,,RanOK
  744.               WriteLine   "TestPgm did not execute properly...terminating"
  745.               Halt        DOSError
  746.               Label       RanOK
  747.               Compare     ErrorLevel,1,Chk2,,Option1
  748.               Concat      MsgLine,"Unexpected return code of ",ErrorLevel
  749.               Halt
  750.               Label       Option1
  751.  
  752.             Note:  PowerBatch  programs may  be executed  by other  PowerBatch
  753.             programs as  external commands.  An option of the  PowerBatch Halt
  754.             command  is  to  set the  DOS  errorlevel.  You could  then  "pass
  755.             parameters"  from  one  PowerBatch  program  to  another  via  the
  756.             ERRORLEVEL variable.
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.             Page 14                     PowerBatch                     Page 14
  765.  
  766.             Command line  parameters may  be passed  to a compiled  PowerBatch
  767.             program. These command line  parameters must be defined at compile
  768.             time and  have special variable names. Up to 16  parameters may be
  769.             passed  to  a  PowerBatch program  and  their  names are  CLP%1  -
  770.             CLP%16.
  771.             If you  wish  to  pass  parameters on  the  command line  to  your
  772.             PowerBatch program, define the variables  in your source  and when
  773.             you  run  the  compiled program,  any  parameters  entered  on the
  774.             command line will be in the defined variable. Example:
  775.  
  776.               Source for SMARTCPY.PWR
  777.  
  778.               Variable    CLP%1,79    ;source file
  779.               Variable    CLP%2,79    ;target file
  780.               Variable    InChar,1
  781.               ReadYN      "Shall I copy the files for you [Y/N] ",InChar
  782.               Compare     InChar,"Y",NoCopy,NoCopy
  783.               COPY        CLP%1, CLP%2
  784.  
  785.               SMARTCPY  FILE1 FILE2 will execute the DOS copy command and copy
  786.             FILE1 to FILE2 if the user responds Y to the question.
  787.  
  788.             Command Notation
  789.             In  the  description  of  the commands  which  follow,  that which
  790.             appears  within brackets  [ ] is  optional and all  other operands
  791.             are  required. Any  time a  screen  color may  be specified  in  a
  792.             command such as
  793.  
  794.               CLEARLINE LineNumber,ForegroundColor,BackgroundColor
  795.  
  796.             the  single attribute which is  used in many color conventions may
  797.             be  substituted  for the  pair of  color attributes.  For example,
  798.             foreground color 4  (red), background color 1 (blue), is identical
  799.             to  color attribute 20 and  the CLEARLINE command may be specified
  800.             EITHER as 
  801.  
  802.               CLEARLINE 14,4,1
  803.             or
  804.               CLEARLINE 14,20
  805.  
  806.             to clear  line  14  on  the  screen  to  red  foreground  on  blue
  807.             background. For  this  reason  anytime that  the operand  pair  of
  808.             foreground  color, background color  is required, the single color
  809.             attribute  may be substituted for  the pair. The compiler will not
  810.             detect  missing background  color attributes but  will assume that
  811.             the foreground is the composite value.
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.             Page 15                     PowerBatch                     Page 15
  820.  
  821.             Command Syntax
  822.             The  number which  is immediately  under the  command name  is the
  823.             line  number in  the DEMO1 file (printed  in the examples section)
  824.             which uses this command.
  825.  
  826.             ?COLOR        VarName1, VarName2, VarName3
  827.             (25) Retrieve  the current  color attributes  from the  system and
  828.                     place  the  current  foreground  color  in  VarName1,  the
  829.                     current  background color  in VarName2,  and the composite
  830.                     attribute in VarName3.
  831.  
  832.                  Ex:   Variable ForeColor,3
  833.                        Variable BackColor,3
  834.                        Variable ColorAttr,3
  835.                        ?Color   ForeColor,BackColor,ColorAttr
  836.  
  837.                     Retrieve  the current foreground, background and composite
  838.                        color  values and  place  in  the variables  ForeColor,
  839.                        BackColor, and ColorAttr repectively.
  840.  
  841.             ?CURRDIR      VarName1, VarName2
  842.                  Retrieve the current drive and directory from the system  and
  843.                     place  the  current  drive in  VarName1  and  the  current
  844.                     directory  in VarName2. The  contents of VarName1 prior to
  845.                     execution of this command  control which currently  logged
  846.                     drive  is searched for  the currently logged directory. If
  847.                     ?CurrDir finds a valid drive letter in the first  position
  848.                     of VarName1,  then the  contents of  VarName2 will be  the
  849.                     currently  logged directory  of that  drive. If  the first
  850.                     position  of  VarName1  does not  contain  a  valid  drive
  851.                     letter, then  VarName2 will contain  the currently  logged
  852.                     directory  of the  current drive. In  either case VarName1
  853.                     will  contain  the drive  and  VarName2 will  contain  the
  854.                     directory.
  855.  
  856.                  Ex:   Variable    CurrDrive,2
  857.                        Variable    CurrDir,79
  858.                        Set         CurrDrive,"A"
  859.                        ?CurrDir    CurrDrive,CurrDir
  860.                        Set         CurrDrive,""
  861.                        ?CurrDir    CurrDrive,CurrDir
  862.  
  863.                  In the first usage of  ?CurrDir, assuming that  the currently
  864.                     logged directory  on the A  drive is  the root  directory,
  865.                     CurrDrive  will contain  "A" and CurrDir  will contain "\"
  866.                     after  the  execution of  ?CurrDir. In  the second  usage,
  867.                     assuming that  the currently  logged drive  is D:  and the
  868.                     currently  logged   directory   on   the   D:   drive   is
  869.                     "\UTIL\EXEC", CurrDrive  will contain "D" and CurrDir will
  870.                     contain "\UTIL\EXEC" after the execution of ?CurrDir.
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.             Page 16                     PowerBatch                     Page 16
  879.  
  880.             ?DATE         VarName1, VarName2, VarName3, VarName4
  881.             (26) Retrieve  the current date from  the system and place the day
  882.                     of  the week  in VarName1, the month  in VarName2, the day
  883.                     in VarName3, and the year in VarName4. VarName1 should  be
  884.                     defined  as 9  long, VarName2 and VarName3  as 2 long, and
  885.                     VarName4 as 4 long.
  886.  
  887.                  Ex:   Variable DOW,9
  888.                        Variable Mo,2
  889.                        Variable Da,2
  890.                        Variable Yr,4
  891.                        ?Date    DOW,Mo,Da,Yr
  892.  
  893.                     Retrieve  the current  date and place  the component parts
  894.                        in  their respective  variables. Place  the day  of the
  895.                        week  in DOW (ie Saturday),  the month number in Mo (ie
  896.                        06),  the day of the  month in Da (ie 29), and the year
  897.                        in Yr (ie 1990).
  898.  
  899.             ?DIREXIST     VarName1, Label1 [,Label2]
  900.             (159)         Literal1,Label1 [,Label2]
  901.                  Check the  system for  the existance of  the directory  whose
  902.                     name  appears in VarName1 or in Literal1. If the directory
  903.                     exists jump to  the command immediately following  Label1,
  904.                     if  the  directory does  not  exist,  jump to  the command
  905.                     immediately following Label2.
  906.  
  907.                  Ex:   ?DirExist   InpStr,DirOk,BadDir
  908.                        ?DirExist   "C:\",DirOK,BadDir
  909.                        ?DirExist   InpStr,,BadDir (next command if exists)
  910.                        ?DirExist   InpStr,DirOk   (next command if not exist)
  911.                  In  the first example if  the contents of the variable InpStr
  912.                     exists then goto  label DirOK, if it  does not exist go to
  913.                     the  label BadDir. In the  second example we check for the
  914.                     existance  of  a literal  with a  value of  "C:\". In  the
  915.                     third example,  if the contents of  InpStr exist we  "fall
  916.                     through"  to the  next instruction, if  the directory does
  917.                     not  exist  we jump  to the  label BadDir.  In the  fourth
  918.                     example, if the directory name in  InpStr exists, we  jump
  919.                     to the label DirOK, if it  does not exist we  fall through
  920.                     to the next command.
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.             Page 17                     PowerBatch                     Page 17
  929.  
  930.             ?DISKSPACE    VarName1, VarName2, VarName3
  931.             (184)         Literal1, VarName1, VarName2
  932.                  Query the  disk Drive  specified by  the  first character  of
  933.                     Varname1 and  place the  total disk capacity  in bytes  in
  934.                     VarName2  and  the unused  bytes  in VarName3.  Since  the
  935.                     command looks at  only the first character of VarName1 (or
  936.                     Literal1),   VarName1  may   contains  strings   such   as
  937.                     "C:\UTIL".
  938.                  Ex:   Variable    DirName,79
  939.                        ReadStr     DirName  (user enters "c:\util")
  940.                        Upper       DirName  (changes to "C:\UTIL")
  941.                        ?DiskSpace  DirName,TotSpace,FreSpace
  942.  
  943.                        ?DiskSpace  "A",TotSpace,FreSpace
  944.  
  945.             ?DRIVEEXIST   VarName1, Label1 [,Label2]
  946.             (145)         Literal1, Label1 [,Label2]
  947.                  Check  the system  for VarName1 as  a valid drive  letter. If
  948.                     the  drive  is  valid, jump  to  the  command  immediately
  949.                     following  Label1, if  the drive is not  valid jump to the
  950.                     command immediately following Label2.
  951.  
  952.                  Ex:   ?DriveExist DrvNum,GoodDrv,BadDrv
  953.                        ?DriveExist "A",GoodDrv,BadDrv
  954.                        ?DriveExist DrvNum,,BadDrv
  955.                        ?DriveExist DrvNum,GoodDrv
  956.  
  957.             ?ENVSTR       VarName1, VarName2
  958.                           Literal1, VarName2
  959.                  Retrieve  the contents  of any environment  variable from the
  960.                     system  environment  area. The  name  of  the  environment
  961.                     variable  is placed  in VarName1  or entered as  a literal
  962.                     and  the  contents of  the  environment variable  will  be
  963.                     placed  in VarName2. Ensure that VarName2 has been defined
  964.                     sufficiently  long enough  to contain the  contents of the
  965.                     environment  variable. If VarName2 is not long enough, the
  966.                     environment variable will be truncated.
  967.  
  968.                  Ex:   Variable    EnvValue,255
  969.                        Variable    EnvName,4,"path"
  970.                        ?EnvStr     "prompt", EnvValue
  971.                        ?EnvStr     EnvName, EnvValue
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.             Page 18                     PowerBatch                     Page 18
  980.  
  981.             ?FILEEXIST    VarName1, Label1 [,Label2]
  982.             (172)         Literal, Label1 [,Label2]
  983.                  Check  the system  for the specified  file name. If  the file
  984.                     exists, jump to the  command immediately following Label1,
  985.                     if   the  file  does   not  exist,  jump  to  the  command
  986.                     immediately following Label2.
  987.  
  988.                  Ex:   ?FileExist  FileName, Label1, Label2
  989.                        ?FileExist  "C:\AUTOEXEC.BAT",StartOK,NoStart
  990.                        ?FileExist  FileName,,Label2
  991.                        ?FileExist  FileName,Label1
  992.  
  993.             ?INPATH       VarName1, Label1 [,Label2]
  994.                           Literal1, Label2 [,Label2]
  995.                  Compare the contents  of VarName1 to  the system search path.
  996.                     If  VarName1  is contained  within  the  path jump  to the
  997.                     command  immediately following  Label1, if  the file  does
  998.                     not  exist  jump  to  the  command  immediately  following
  999.                     Label2. Use  this command  to determine if a  directory is
  1000.                     specified in the DOS search path.
  1001.  
  1002.                  Ex:   DOS search path contains "C:\UTIL;C:\WORDPROC;D:\"
  1003.                        Variable    InString,79
  1004.                        Write       "Enter your directory name "
  1005.                        ReadStr     InString (user enters "c:\wordproc")
  1006.                        Upper       InString (change to "C:\WORDPROC")
  1007.                        ?InPath     InString,PathOK,BadPath
  1008.  
  1009.                        ?InPath     "C:\UTIL",,BadPath   (compare literal)
  1010.  
  1011.             ?TIME         VarName1
  1012.             (27) Retrieve  the  current time  from  the  system and  place  in
  1013.                     VarName1. The format  of the time is hh:mm:ss xm. VarName1
  1014.                     should be defined as 11 long.
  1015.                  Ex:   Variable CurrTime,11
  1016.                        ?Time    CurrTime (now contains 11:24:14 am)
  1017.  
  1018.  
  1019.             BEEP          VarName1, VarName2, VarName3
  1020.             (149)         Literal1, Literal2, Literal3
  1021.                  Sound  the system speaker  with a tone of VarName1 frequency,
  1022.                     for  a length  of VarName2 tenths of  a second, and repeat
  1023.                     VarName3 times.
  1024.                  Ex:   Beep  800,5,3
  1025.                        Beep  ErrFreq,BeepLen,ErrTimes
  1026.                     The first  example sound the system speaker at a frequency
  1027.                        of 800 hz for half a second (.5) and  repeats twice for
  1028.                        a  total of 3 times.  The second example will sound the
  1029.                        system speaker at a frequency equal to the contents  of
  1030.                        the  variable ErrFreq for BeepLen tenths of a second(s)
  1031.                        for a total of ErrTimes.
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.             Page 19                     PowerBatch                     Page 19
  1040.  
  1041.             BLINK
  1042.             (82)
  1043.                  Cause all  text that is written to the screen  to blink using
  1044.                     the  current   color  attributes   last  defined   in  the
  1045.                     processing  of the batch program. This command in "undone"
  1046.                     by using NORMAL.
  1047.  
  1048.                  Ex:   Variable MsgClear,25."                         "
  1049.                        Blink
  1050.                        WriteAt  15,4,"Not a valid entry"
  1051.                        Normal
  1052.                        Wait     35
  1053.                        WriteAt  15,4,MsgClear
  1054.                     Write the message "Not a valid entry" at column  15 on row
  1055.                        4  using the  current color definition.  Reset the text
  1056.                        color  to  the  value  it  contained before  specifying
  1057.                        blinking text. Wait 3.5 seconds and clear the message.
  1058.  
  1059.             BOX1          VarNm1, VarNm2, VarNm3, VarNm4, VarNm5 [,VarNm6]
  1060.             (36)          Lit1, Lit2, Lit3, Lit4, Lit5 [,Lit6]
  1061.                  Draw  a  box  (frame) on  the  screen  whose upper  left  co-
  1062.                     ordinates  (X,Y) are VarNm1, VarNm2, and whose lower right
  1063.                     co_ordinates  (X,Y) are VarNm3, VarNm4. Draw the box using
  1064.                     a  line  in foreground  color VarNm5  on background  color
  1065.                     VarNm6.
  1066.  
  1067.                  Ex:   Variable ULX,2,5     ;upper left col value
  1068.                        Variable ULY,2,3     ;upper left row value
  1069.                        Variable LRX,2,75    ;lower right col value
  1070.                        Variable LRY,2,20    ;lower right row value
  1071.                        Variable BoxFore,2,4 ;foreground color red
  1072.                        Variable BoxBack,2,0 ;background color black
  1073.                        Box1  ULX, ULY, LRX, LRY, BoxFore, BoxBack
  1074.                        Box1  5,3,75,20,7,0
  1075.                        Box1  5,3,75,20,112
  1076.  
  1077.                     The  first  example  draws  a  box whose  upper  left  co-
  1078.                        ordinates  are the  contents of  the variables  ULX and
  1079.                        ULY  and whose lower left co-ordinates are the contents
  1080.                        of  the variables  LRX and LRY. The  box border will be
  1081.                        the  contents  of  BoxFore (red)  on  a  background  of
  1082.                        BoxBack  (black).  The  interior of  the  box  will  be
  1083.                        unchanged  (ie it  is  not  cleared  nor is  the  color
  1084.                        changed).  The second  example draws a  box whose upper
  1085.                        left  co-ordinates are  5,3 and  whose lower  right co-
  1086.                        ordinates are  75,20. The box  border is drawn in white
  1087.                        on  black. The third example  draws a box with the same
  1088.                        co-ordinates and uses the composite  color attribute of
  1089.                        112 (white on black). See ClearBox command.
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.             Page 20                     PowerBatch                     Page 20
  1098.  
  1099.             BREAKON
  1100.                  Provides  a capability to  exit from  a PowerBatch program by
  1101.                     pressing  the  combination  of  keys  (Ctrl  -  Break)  or
  1102.                     (Ctrl - C). The default value set at the beginning of  any
  1103.                     PowerBatch  program  is  BreakON.  To  keep  a  user  from
  1104.                     exiting   a  running   PowerBatch  program,   execute  the
  1105.                     BreakOFF command. If  sections of  the program  are to  be
  1106.                     protected and  other sections not,  surround the  sections
  1107.                     with pairs of BreakON...BreakOFF commands.
  1108.  
  1109.             BREAKOFF
  1110.                  Disables   the  ability  to  stop  a  PowerBatch  program  by
  1111.                     pressing  the   (Ctrl  -   Break)  or  (Ctrl   -  C)   key
  1112.                     combinations.  The default  value set at  the beginning of
  1113.                     any PowerBatch program is BreakON.
  1114.  
  1115.             CENTER        VarName1, VarName2
  1116.             (42)          Literal1, Literal2
  1117.                  Center the text in VarName1 on line VarName2.
  1118.  
  1119.                  Ex:   Variable InpStr,25,"PowerBatch"
  1120.                        Center   "PowerBatch",2
  1121.                        Center   InpStr,2
  1122.  
  1123.                     Both  versions  of  this  example  will  center  the  name
  1124.                        "PowerBatch" on line 2 of the screen.
  1125.  
  1126.             CLEAR         VarName1 [,VarName2]
  1127.             (28)          Literal1 [,Literal2]
  1128.                  Clear  the  entire screen  to foreground  color VarName1  and
  1129.                     background color VarName2.
  1130.  
  1131.                  Ex:   Variable ColorAttr,3,112   ;define white on black
  1132.                        Clear    4,1
  1133.                        Clear    112
  1134.                        Clear    ColorAttr
  1135.                     The  first example  clears the screen to  red on blue. The
  1136.                        second and third examples  clear the screen to white on
  1137.                        black.
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.             Page 21                     PowerBatch                     Page 21
  1146.  
  1147.             CLEARBOX      VarNm1, VarNm2, VarNm3, VarNm4, VarNm5 [,VarNm6]
  1148.             (37)          Lit1, Lit2, Lit3, Lit4, Lit5 [,Lit6]
  1149.                  Clear the interior of the box  whose upper left  co-ordinates
  1150.                     (X,Y)  are  VarNm1,  VarNm2  and  whose  lower  right  co-
  1151.                     ordinates  (X,Y) are VarNm3, VarNm4. Clear the interior of
  1152.                     the  box to  foreground color VarNm5  and background color
  1153.                     VarNm6. This command clears the  "inside" of the  box, not
  1154.                     the lines which describe the box.
  1155.                  Ex:   Variable ULX,2,5     ;upper left col value
  1156.                        Variable ULY,2,3     ;upper left row value
  1157.                        Variable LRX,2,75    ;lower right col value
  1158.                        Variable LRY,2,20    ;lower right row value
  1159.                        Variable BoxFore,2,4 ;foreground color red
  1160.                        Variable BoxBack,2,0 ;background color black
  1161.                        Box1     ULX, ULY, LRX, LRY, BoxFore, BoxBack
  1162.                        ClearBox 5,3,75,20,112
  1163.  
  1164.                     In  this example we define  the upper right and lower left
  1165.                        co-ordinates of  the box as  well as the colors BoxFore
  1166.                        and  BoxBack. We  draw the  box with  a red  line on  a
  1167.                        black  background.  The  ClearBox  command  clears  the
  1168.                        interior of the box to white on black.
  1169.  
  1170.             CLEARLINE     VarName1, VarName2 [,VarName3]
  1171.                           Literal1, literal2 [,Literal3]
  1172.                  Clear  the line number specified by VarName1  to a foreground
  1173.                     color of VarName2 and a background color of VarName3.
  1174.  
  1175.                  Ex:   Variable    Red,1,4
  1176.                        Variable    Blue,1,1
  1177.                        Variable    RedOnBlue,2,20
  1178.                        Variable    CurrLine,2,12
  1179.                        ClearLine   12,Red,Blue
  1180.                        ClearLine   CurrLine,RedOnBlue
  1181.  
  1182.                     Both examples  of the ClearLine command  clear line 12  on
  1183.                        the  screen to red foreground color and blue background
  1184.                        color.
  1185.  
  1186.             COLOR         VarName1 [,VarName2]
  1187.             (38)          Literal1 [,Literal2]
  1188.                  Set  the  default  color to  foreground  color  VarName1  and
  1189.                     background color  VarName2 or optionally  set the  default
  1190.                     color attribute to VarName1.
  1191.                  Ex:   Variable RedOnBlue,2,20
  1192.                        Color    4,1
  1193.                        Color    MenuClr
  1194.  
  1195.                     Both  examples set  the default color  to red on  blue for
  1196.                        any  text written to  the screen without specific color
  1197.                        instructions.
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.             Page 22                     PowerBatch                     Page 22
  1206.  
  1207.             COMPARE    VarName1, VarName2, Label1 [,Label2] [,Label3]
  1208.             (30)       Literal1, Literal2, Label1 [,Label2] [,Label3]
  1209.                  Compare   the  contents  of   VarName1  to  the  contents  of
  1210.                     VarName2.  If VarName1  greater than VarName2  jump to the
  1211.                     statement   following  Label1.   If  VarName1   less  than
  1212.                     VarName2  jump  to  the  statement  following  Label2.  If
  1213.                     VarName1 equal  VarName2 jump  to the statement  following
  1214.                     Label3.   If  the  contents  of  the  first  two  operands
  1215.                     (VarName1,  VarName2, Literal1,  or Literal2)  are numeric
  1216.                     then  a   numeric  compare  is   performed  otherwise   an
  1217.                     alphabetic   compare  is   made.   (If   19  is   compared
  1218.                     alphabetically to 2, then 2  is greater than 19;  if it is
  1219.                     compared numerically, 19 is greater than 2.)
  1220.  
  1221.                  Ex:   Variable InChar,1
  1222.                        Variable Yes,1,"Y"
  1223.                        Variable No,1,"N"
  1224.                        GoToXY   4,23
  1225.                        ReadYN   "Incorrect entry...Continue [Y/N] "
  1226.                        Compare  InChar,"Y",NoIn,NoIn,YesIn
  1227.  
  1228.                        Compare  InChar,Yes,,,YesIn   (Not Y falls thru)
  1229.  
  1230.                        Compare  InChar,"Y",NoIn,NoIn (Y falls thru)
  1231.  
  1232.                     In  the  first example  of the  Compare command,  variable
  1233.                        InChar  is  compared  to  literal  "Y".  If  InChar  is
  1234.                        greater than  "Y"  then the  program will  jump to  the
  1235.                        label NoIn;  if InChar  is less  than "Y",  the program
  1236.                        also  jumps to  the label NoIn;  if InChar is  equal to
  1237.                        "Y",  the program will continue processing at the label
  1238.                        named  YesIn.  In  the   second  compare  command,  the
  1239.                        variable  InChar is compared  to the variable Yes which
  1240.                        has an  assigned value of  "Y". If  the variable InChar
  1241.                        contains anything  but "Y", the  program continues with
  1242.                        the  next instruction after  the compare command (it is
  1243.                        said  to  fall through);  if InChar  contains "Y",  the
  1244.                        program will  jump to  the  label YesIn.  In the  third
  1245.                        compare command,  variable InChar  is  compared to  the
  1246.                        literal  "Y".  If  the  variable  InChar  contains  "N"
  1247.                        (ReadYN  prevents  any entry  but Y  or N)  the program
  1248.                        jumps  to the  label NoIn  otherwise it  continues with
  1249.                        the instruction after the compare command.
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.             Page 23                     PowerBatch                     Page 23
  1258.  
  1259.             CONCAT     VarName1, VarName2 [,VarName3]
  1260.             (116)      VarName1, Literal1 [,Literal2]
  1261.                  Concatenate  the  string  in  VarName2  with  the  string  in
  1262.                     VarName3 and place the result in VarName1. If VarName3  is
  1263.                     not  present then concatenate  the string in VarName1 with
  1264.                     the string in VarName2 and place the result in VarName1.
  1265.                  Ex:   Variable    OutMsg,78
  1266.                        Variable    ErrMsg," is not a valid Drive letter."
  1267.                        Variable    DriveLtr,1
  1268.                        WriteAt     6,17,"Enter your source drive letter "
  1269.                        ReadUpKey   DriveLtr
  1270.                        ?DriveExist DriveLtr,DriveOK
  1271.                        Concat      OutMsg, "[19] ", DriveLtr
  1272.                        Concat      OutMsg, " is not a valid Drive letter."
  1273.                        WriteAt     5,23,OutMsg
  1274.  
  1275.                     In  this example we  ask the  user to input  a valid drive
  1276.                        letter  and  verify  this  drive  with  the ?DriveExist
  1277.                        command.  If  the drive  is  not valid  we  concatenate
  1278.                        "[19]"  (the  error  number)  plus   the  drive  letter
  1279.                        entered by the user into the  variable OutMsg. We  then
  1280.                        concatenate the error  message (" is not a valid  Drive
  1281.                        letter.")  onto  the  contents  of  OutMsg. The  result
  1282.                        would  be something  like "[19] L is  not a valid Drive
  1283.                        letter."
  1284.  
  1285.             GOTO       Label1
  1286.             (152)
  1287.                  Jump to the statement identified as command label Label1.
  1288.                  Ex:   GoTo  Error
  1289.                        GoTo  EndOfPgm
  1290.  
  1291.             GOTOXY     VarName1, VarName2
  1292.             (57)       Literal1, Literal2
  1293.                  Move  the cursor to the  column (X) specified in VarName1 and
  1294.                     row (Y) specified in VarName2.
  1295.                  Ex:   Variable CurrX,2
  1296.                        Variable CurrY,2
  1297.                        GoToXY   CurrX, CurrY
  1298.                        GoToXY   12,6
  1299.  
  1300.                     In  the first example the  cursor is moved to the location
  1301.                        specified  by the contents of variable CurrX and CurrY.
  1302.                        In  the second  example,  the cursor  is  moved  to the
  1303.                        location specified by two literals "12" and "6".
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.             Page 24                     PowerBatch                     Page 24
  1312.  
  1313.             HALT       VarName1
  1314.                        Literal1
  1315.                  Halt the  batch file  processing and  set  DOS errorlevel  to
  1316.                     VarName1.
  1317.                  Ex:   Variable Error14,2,14   ;define Error14 as "14"
  1318.                        Halt     99
  1319.                        Halt     Error14
  1320.  
  1321.                     In the  first usage  of the Halt  command, the  PowerBatch
  1322.                        program  is halted and the DOS errorlevel is set to 99.
  1323.                        In  the second usage the  program is halted and the DOS
  1324.                        errorlevel  is set to  the contents of variable Error14
  1325.                        ("14").
  1326.  
  1327.             LABEL      LabelName
  1328.             (34) Define  a location  in the list of  commands that will enable
  1329.                     execution  to  begin  immediately following  this  command
  1330.                     without    necessarily   having   executed   the   command
  1331.                     immediately  prior to the  Label. Jump immediately to this
  1332.                     location  in  the command  stream. See  the discussion  on
  1333.                     labels at the beginning of this section.
  1334.  
  1335.                  Ex:   Label    MatchErr
  1336.                        Label    EndOfPgm
  1337.  
  1338.             LENGTH     VarName1, VarName2
  1339.             (129)      VarName1, Literal1
  1340.                  Calculate the  length of the  string in variable VarName2 and
  1341.                     place the result in VarName1.
  1342.                  Ex:   Variable InString
  1343.                        Variable StrLen
  1344.                        WriteAt  12,14,"Enter your current directory "
  1345.                        ReadStr  InString (user enters c:\util)
  1346.                        Length   StrLen, InString  (StrLen will contain 7)
  1347.  
  1348.             LOWER      VarName1
  1349.             (104)
  1350.                  Change the alphabetic characters in VarName1 to lower case.
  1351.                  Ex:   Variable InString,25
  1352.                        ReadStr  InString (user enters C:\UTIL)
  1353.                        Lower    InString (now contains c:\util)
  1354.  
  1355.             MIDSTRING  VarName1, VarName2, VarName3, VarName4
  1356.             (114)      VarName1, Literal1, Literal2, Literal3
  1357.                  Extract  a substring of VarName2 beginning at offset VarName3
  1358.                     into VarName2  for  a length  of VarName4  and place  this
  1359.                     substring in VarName1.
  1360.  
  1361.                  Ex:   Variable Path,79
  1362.                        WriteAt     1,2,"Enter Drive and Directory name "
  1363.                        ReadStr     Path  (user enters C:\UTIL)
  1364.                        MidString   Drive,Path,1,2 (extract C: from C:\UTIL)
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.             Page 25                     PowerBatch                     Page 25
  1373.  
  1374.  
  1375.             NORMAL
  1376.             (84) Change  the current color attribute(s) back to the definition
  1377.                     prior to the execution of a BLINK or REVERSE command.
  1378.  
  1379.                  Ex:   Color    20    ;set default color to red on blue
  1380.                        Blink          ;changes to blinking red on blue (148)
  1381.                        WriteAt  2,24,"Incorrect...re-enter!"
  1382.                        Normal         ;resets color to 20
  1383.                        Beep     800,8
  1384.                        Wait     35    ;pause 3.5 seconds
  1385.                        WriteAt  2,24,"                    "   ;clear     error
  1386.             msg
  1387.  
  1388.                     This  is an example of  a typical error routine. The color
  1389.                        attribute  is  changed   to  blinking  with  the  Blink
  1390.                        command.  The error  message is  written and  the color
  1391.                        attribute  is changed  back to its  original value with
  1392.                        the  Normal command. The  speaker is "beeped" and after
  1393.                        a wait  of 3.5  seconds, the  error message  is removed
  1394.                        from the screen.
  1395.  
  1396.             READKEY    VarName1
  1397.             (59) Read a single key from the keyboard  and place the result  in
  1398.                     VarName1.
  1399.  
  1400.                  Ex:   Variable CharIn,1
  1401.                        GoToXY   1,14
  1402.                        Write    "Enter the drive letter for output ",4,1
  1403.                        ReadKey  CharIn
  1404.  
  1405.             READSTR    VarName1
  1406.             (109)
  1407.                  Read  a string of characters from the keyboard until the user
  1408.                     presses the  enter key. Any  number of  characters may  be
  1409.                     read up  to the maximum length  specified for VarName1  in
  1410.                     the Variable statement.
  1411.  
  1412.                  Ex:   Variable    InString,12
  1413.                        ReadStr     InString    (12 chars max will be read)
  1414.  
  1415.             READUPKEY  VarName1
  1416.             (144)
  1417.                  Read a single character from the keyboard,  changing the case
  1418.                     of any alphabetic  character to upper case and place  this
  1419.                     upper case character in VarName1.
  1420.  
  1421.                  Ex:   ReadUpKey   CharIn
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.             Page 26                     PowerBatch                     Page 26
  1430.  
  1431.             READYN     VarName1, VarName2
  1432.             (29)       Literal1, VarName2
  1433.                  Write  the message found  in VarName1  at the  current cursor
  1434.                     location and wait for a single key to be entered from  the
  1435.                     keyboard. Force  the user to enter either a "Y" or "N" and
  1436.                     place the upper case "Y" or "N" in VarName2.
  1437.  
  1438.                  Ex:   Variable    Msg4,35,"Invalid filename...Continue  [Y/N]
  1439.             "
  1440.                        ReadYN      "Invalid     filename...Continue      [Y/N]
  1441.             ",CharIn
  1442.  
  1443.                        ReadYN      Msg4,CharIn
  1444.  
  1445.                  In both usages  of the  ReadYN command, the message  "Invalid
  1446.                     filename...Continue [Y/N]  "  will  be displayed  and  the
  1447.                     program  will wait  for a response  from the user.  If the
  1448.                     user enters  any characters other than  "Y", "y", "N",  or
  1449.                     "n"  the  system  speaker  will  sound  and  the  user  is
  1450.                     prompted  again  for  input. At  the  completion  of  this
  1451.                     command,  the variable  CharIn will contain  either "Y" or
  1452.                     "N" (always upper case).
  1453.  
  1454.             REVERSE
  1455.                  Change  the  text  attributes to  "reverse  video".  This  is
  1456.                     accomplished  by  swapping the  foreground and  background
  1457.                     attributes. This command is "undone" by using NORMAL.
  1458.  
  1459.                  Ex:   Color    20    ;red on black
  1460.                        Reverse        ;color is changed to black on red
  1461.                        WriteAt  1,15,"Press Escape To Continue"
  1462.                        Normal         ;color is now red on black
  1463.  
  1464.             SETVAR     VarName1, VarName2
  1465.             (31)       VarName1, Literal1
  1466.                  Set the value of VarName1 to the contents of VarName2.
  1467.  
  1468.                  Ex:   Variable ErrCode,3
  1469.                        Variable FileName,79
  1470.                        SetVar   ErrCode,99
  1471.                        SetVar   FileName,"C:\CONFIG.SYS"
  1472.  
  1473.                     In the first  usage of  the SetVar  command, the  variable
  1474.                        ErrCode  is set  to "99" and the  second usage sets the
  1475.                        variable FileName to "C:\CONFIG.SYS"
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.             Page 27                     PowerBatch                     Page 27
  1484.  
  1485.             UPPER      VarName1
  1486.             (101)
  1487.                  Change the alphabetic characters in VarName1 to upper case.
  1488.  
  1489.                  Ex:   Variable InString,25
  1490.                        WriteAt  14,25,"Enter your directory name "
  1491.                        ReadStr  InString    (user enters c:\util)
  1492.                        Upper    InString    (changed to C:\UTIL)
  1493.                        ?InPath  InString,GoodDir  (path is always upper case)
  1494.  
  1495.                     In this example,  the user is prompted  for a path name to
  1496.                        be  entered. The  path name  is to  be compared  to the
  1497.                        system  path for  validity. Since  the contents  of the
  1498.                        system  path are  always in  upper case, we  change the
  1499.                        InString variable to upper case prior to comparision.
  1500.  
  1501.             VARIABLE   VariableName, MaxLength [,InitialValue]
  1502.             (1)  Define  a variable  to PowerBatch.  All variables  used in  a
  1503.                     PowerBatch  program must have been defined with a VARIABLE
  1504.                     command. VariableName is the  name which you  give to this
  1505.                     variable  and the means by which you refer to the variable
  1506.                     in other PowerBatch statements. This variable may  contain
  1507.                     any  number of  characters up to  MaxLength and is  set to
  1508.                     the  initial value of  InitialValue. See the discussion on
  1509.                     variables at the beginning of this section.
  1510.                  Command  line  parameters  passed to  a  compiled  PowerBatch
  1511.                     program must  be defined  as variables. Up  to 16  command
  1512.                     line  variables  may be  passed to  a compiled  PowerBatch
  1513.                     program  and they  are defined  as CLP%1..CLP%16.  See the
  1514.                     example MOVE1 or MOVE2.
  1515.  
  1516.                  Ex:   Variable    DayOfWeek,9
  1517.                        Variable    ErrMsg1,25,"Invalid directory name."
  1518.                        Variable    InString,80,""
  1519.                        Variable    PauseTime,2,50
  1520.                        Variable    CLP%1,12       (command line parameter %1)
  1521.  
  1522.             WAIT       VarName1
  1523.             (119)      Literal1
  1524.                  Cause  the execution  of a  PowerBatch program  to pause  for
  1525.                     VarName1 tenths of a second(s).
  1526.  
  1527.                  Ex:   Wait        5           (pause half a second)
  1528.                        Wait        PauseTime   (pause 5 seconds)
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.             Page 28                     PowerBatch                     Page 28
  1537.  
  1538.             WRITE      VarName1, VarName2 [,VarName3]
  1539.             (58)       Literal1, Literal2 [,Literal3]
  1540.                  Write the string contained in VarName1  at the current cursor
  1541.                     location using  color attributes  foreground VarName2  and
  1542.                     background  VarName3.  In  the  absence  of  VarName2  and
  1543.                     VarName3  use the current  color attributes. The string is
  1544.                     not  followed by a carriage return, line feed pair (ie the
  1545.                     cursor  is not  moved to  the first  position of  the next
  1546.                     line).
  1547.  
  1548.                  Ex:   Write    "Enter your password ",0,7
  1549.                        Variable ErrMsg1,25,"Invalid directory name."
  1550.                        Variable ErrClr,3,112
  1551.                        Write    ErrMsg1,ErrClr
  1552.  
  1553.             WRITEAT    VarName1, VarName2, VarName3 [,VarName4] [,VarName5]
  1554.             (46)       Literal1, Literal2, Literal3 [,Literal4] [,Literal5]
  1555.                  Write   the  string  contained  in  VarName3  at  column  (X)
  1556.                     contained  in VarName1  and row (Y)  contained in VarName2
  1557.                     using   the  foreground   color  attribute   contained  in
  1558.                     VarName4 and  the background color  attribute contained in
  1559.                     VarName5.  In the  absence of  VarName4 and  VarName5, use
  1560.                     the  current color  attributes. The string is not followed
  1561.                     by  a carriage  return, line feed  pair (ie the  cursor is
  1562.                     not moved to the first position of the next line).
  1563.                  Ex:   Variable TitleClr,3,112
  1564.                        Variable CurrX,2
  1565.                        Variable CurrY,2
  1566.                        Variable CompName,25,"The ABC Company"
  1567.                        WriteAt  15,3,"The ABC Company",TitleClr
  1568.                        WriteAt  CurrX,CurrY,CompName
  1569.  
  1570.                     In  the first  usage  of the  WriteAt command  the literal
  1571.                        "The  ABC Company"  is written at column  15, row 3. In
  1572.                        the  second   usage,  the  contents   of  the  variable
  1573.                        CompName  ("The ABC Company")  is written at the column
  1574.                        location  specified by  the contents  of variable CurrX
  1575.                        and  at the row  location specified  by the contents of
  1576.                        variable CurrY.
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.             Page 29                     PowerBatch                     Page 29
  1585.  
  1586.             WRITELINE  VarName1 [,VarName2]
  1587.             (195)
  1588.                  Write  the string contained in VarName1 beginning in location
  1589.                     1 of  the line  number specified in  VarName2. Follow  the
  1590.                     string  with a carriage return line feed pair (ie move the
  1591.                     cursor  to the  first position of  the next line).  In the
  1592.                     absence  of  VarName2  write the  string  at  the  current
  1593.                     cursor location.
  1594.  
  1595.                  Ex:   WriteLine   "Please read these instructions ",7
  1596.                        WriteLine   Msg5
  1597.  
  1598.                     In the first  usage of WriteLine the message "Please  read
  1599.                        these  instructions " is  written beginning in column 1
  1600.                        of  row  7. In  the second  usage the  contents of  the
  1601.                        variable  Msg5  is  written  beginning  at the  current
  1602.                        cursor  location. In both cases a carriage return, line
  1603.                        feed  (position  cursor at  the first  position of  the
  1604.                        next line) is written.
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.             Page 30                     PowerBatch                     Page 30
  1613.  
  1614.                                      Command Summary
  1615.  
  1616.             ?COLOR        Var1, Var2, Var3 
  1617.             ?CURRDIR      Var1, Var2
  1618.             ?DATE         Var1, Var2, Var3, Var4
  1619.             ?DIREXIST     Var1, Lab1 [,Lab2]  or Lit1, Lab1 [,Lab2]
  1620.             ?DISKSPACE    Var1, Var2, Var3
  1621.             ?DRIVEEXIST   Var1, Lab1 [,Lab2] or Lit1, Lab1 [,Lab2]
  1622.             ?ENVSTR       Var1, Var2 or Lit1, Var2
  1623.             ?FILEEXIST    Var1, Lab1 [,Lab2] or Lit1, Lab1 [,Lab2]
  1624.             ?INPATH       Var1, Lab1 [,Lab2] or Lit1, Lab1 [,Lab2]
  1625.             ?TIME         Var1
  1626.             BEEP          Var1, Var2, Var3 or Lit1, Lit2, Lit3
  1627.             BLINK
  1628.             BOX1          Var1,  Var2, Var3,  Var4, Var5 [,V6]  or Lit1, Lit2,
  1629.                           Lit3, Lit4, Lit5, [,Lit6]
  1630.             BREAKON
  1631.             BREAKOFF
  1632.             CENTER        Var1, Var2 or Lit1, Lit2
  1633.             CLEAR         Var1 [,Var2] or Lit1 [,Lit2]
  1634.             CLEARBOX      Var1,  Var2, Var3,  Var4, Var5 [,V6]  or Lit1, Lit2,
  1635.                           Lit3, Lit4, Lit5 [,Lit6]
  1636.             CLEARLINE     Var1, Var2 [,Var3] or Lit1, Lit2, Lit3
  1637.             COLOR         Var1 [,Var2] or Lit1 [,Lit2]
  1638.             COMPARE       Var1,  Var2, Lab1  [,Lab2]  [,Lab3]  or Lit1,  Lit2,
  1639.                           Lab1 [,Lab2] [,Lab3]
  1640.             CONCAT        Var1, Var2 [,Var3] or Var1, Lit2 [,Lit3]
  1641.             GOTO          Lab1
  1642.             LENGTH        Var1, Var2 or Var1, Lit1
  1643.             LOWER         Var1 
  1644.             MIDSTRING     Var1, Var2, Var3, Var4 or Var1, Var2, Lit1, Lit2
  1645.             NORMAL
  1646.             READKEY       Var1
  1647.             READSTR       Var1
  1648.             READUPKEY     Var1
  1649.             READYN        Var1, Var2 or Lit1, Var1
  1650.             REVERSE
  1651.             SET           Var1, Var2 or Var1, Lit1
  1652.             UPPER         Var1
  1653.             VARIABLE      VariableName, MaxLength [,InitialValue]
  1654.             WAIT          Var1 or Lit1
  1655.             WRITE         Var1, Var2 [,Var3] or Lit1, Lit2 [,Lit2]
  1656.             WRITEAT       Var1,  Var2, Var3  [,Var4]  [,Var5] or  Lit1,  Lit2,
  1657.                           Lit3, [,Lit4] [,Lit5]
  1658.             WRITELINE     Var1 [,Var2] or Lit1 [,Lit2]
  1659.             ERRORLEVEL    Predefined  variable  containing the  value  of  the
  1660.                           exit code set by the previous program or command.
  1661.  
  1662.             DOSERROR      Predefined variable  containing the  last set  value
  1663.                           of the operating system error code.
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.             Page 31                     PowerBatch                     Page 31
  1672.  
  1673.                                     Compilation Errors
  1674.  
  1675.             Compilation  errors are printed on  the screen and also written in
  1676.             a  file named  POWERBAT.ERR (If  you have  a split  screen editor,
  1677.             view  the source  in one screen part  and the errors  in the other
  1678.             part).  If  the  source line  is  available,  the source  line  is
  1679.             printed  above the error preceded by the line number count. Source
  1680.             lines  are not  available during the  second pass of  the compiler
  1681.             which may generate "Label not defined" and "Variable not  defined"
  1682.             errors.
  1683.  
  1684.               "Not a valid command" -  This error is generated  when the first
  1685.                  word  on the  command line  is not  a PowerBatch  command and
  1686.                  contains more than 8 characters.
  1687.  
  1688.                  Example:
  1689.                     13 Directory name checked here.
  1690.                     [DIRECTORY] Not a valid command
  1691.  
  1692.                     Probably should be ;Directory name checked here
  1693.  
  1694.               "Missing variable" -  A command contains less than the  required
  1695.                  number of operands.
  1696.  
  1697.                  Example:
  1698.                     21 ?Color   ForeColor,BackColor
  1699.                     [] Missing variable
  1700.  
  1701.                     Variable for the composite color byte is missing.
  1702.  
  1703.               "Expected a variable  Name" - A string  was found in an  operand
  1704.                  that may contain only a variable name.
  1705.  
  1706.                  Example:
  1707.                     10 ?Time "Current Time"
  1708.                     [Current Time] Expected a variable name
  1709.  
  1710.                     The current time may only be placed in a variable.
  1711.  
  1712.               "Quoted   literal  not   terminated"  -   A  single   quote  was
  1713.                  encountered within a source line.
  1714.  
  1715.                  Example:
  1716.                     9 Center "Move Command,5
  1717.                     [] Quoted literal not terminated
  1718.  
  1719.                     Closing quote should precede comma.
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.             Page 32                     PowerBatch                     Page 32
  1728.  
  1729.               "Invalid  max  length  specified"  -  The second  operand  of  a
  1730.                  variable  definition should specify the maximum length of the
  1731.                  variable. The value found was not numeric.
  1732.  
  1733.                  Example:
  1734.                     3 Variable  CompName,"The ABC Company"
  1735.                     [The ABC Company] Invalid max length specified
  1736.  
  1737.               "Variable not defined" -  A reference to a variable was made  in
  1738.                  the  source file  but the variable  was not defined  with the
  1739.                  Variable command.
  1740.  
  1741.                  Example:
  1742.                     [CURRDATE] Variable not defined
  1743.  
  1744.               "Duplicate  variable" - The same variable name has appeared 2 or
  1745.                  more times in a Variable definition statement.
  1746.  
  1747.                  Example:
  1748.                     7 Variable  CompName,25
  1749.                     [COMPNAME] Duplicate variable
  1750.  
  1751.               "Duplicate label" - The same  label name has appeared  2 or more
  1752.                  times in a Label definition statement.
  1753.  
  1754.                  Example:
  1755.                     16 Label    Step2
  1756.                     [STEP2] Duplicate label
  1757.  
  1758.               "External command >" - This  is not an error  message, but is  a
  1759.                  check  to alert  you to  each command  found in  a PowerBatch
  1760.                  source  file  that will  be treated  as an  external command.
  1761.                  External  commands are DOS intrinsic commands, .COM, and .EXE
  1762.                  commands or programs (even PowerBatch  compiled programs) and
  1763.                  .BAT  (standard DOS  batch files) that are  to be executed by
  1764.                  PowerBatch.
  1765.  
  1766.                  Example:
  1767.                     External command > 12 DIR     (DOS directory command)
  1768.                     External command > 29 MYPROG  (Executable module MYPROG)
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.             Page 33                     PowerBatch                     Page 33
  1777.  
  1778.                            Removing PowerBatch From Your System
  1779.  
  1780.             While  we  believe  that  PowerBatch  is  a  batch  compiler  that
  1781.             everyone should own, we recognize that there are some who feel  it
  1782.             is not a  program they will use on  a regular basis. For those  of
  1783.             you in that minority,  we have provided a program to easily remove
  1784.             all PowerBatch modules  from your  system. To  remove all  modules
  1785.             from  your system  that were  supplied on  the  PowerBatch install
  1786.             disk, enter
  1787.  
  1788.               DELETEPB <enter>
  1789.  
  1790.             You  will be asked  if you wish  to remove  all PowerBatch modules
  1791.             from  the  currently logged  disk. If  this is  the correct  disk,
  1792.             enter Y. If it is  not the correct disk, enter  N and the  program
  1793.             will  terminate. (You  should  move  to  the disk  containing  the
  1794.             PowerBatch  modules.)  You  will next  be  asked  if you  wish  to
  1795.             confirm  each deletion. If you reply (Y)es, each time a PowerBatch
  1796.             module is found,  you will  be asked  if you  wish to delete  this
  1797.             module. If  you reply (N)o,  the modules will  be deleted as  they
  1798.             are found without your intervention.
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.  
  1805.  
  1806.             Page 34                     PowerBatch                     Page 34
  1807.  
  1808.                                          Examples
  1809.  
  1810.             The source for  these examples is  contained on  your installation
  1811.             disk. These examples may be compiled using the POWERMAK command.
  1812.  
  1813.             Example:      POWERMAK DEMO1 <enter>
  1814.  
  1815.                                           DEMO1
  1816.  
  1817.             This  listing  for  DEMO1  contains  line  numbers  preceding  the
  1818.             PowerBatch  command. These line numbers are for reference purposes
  1819.             within the  documentation and  are not  contained  in the  source.
  1820.             Line numbers are in fact not allowed in any PowerBat source file.
  1821.  
  1822.                1     Variable          Fore,1           ;save area for initial
  1823.             colors
  1824.                2    Variable        Back,1
  1825.                3    Variable        ColorAttr,1
  1826.                4    Variable        CharIn,1      ;for user responses
  1827.                5    Variable        RedOnGray,3,116
  1828.                6    Variable        RedOnBlack,3,4
  1829.                7    Variable        YelOnBlue,3,30
  1830.                8    Variable        YelOnGray,3,126
  1831.                9    Variable        BlueOnGray,3,113
  1832.               10    Variable        DOW,9                ;for date command
  1833.               11    Variable        Mo,2
  1834.               12    Variable        Da,2
  1835.               13    Variable        Yr,4
  1836.               14    Variable        CurrTime,11   ;for current time
  1837.               15    Variable        DirName,78    ;for user entered dir name
  1838.               16    Variable        FileName,78   ;for user entered file name
  1839.               17    Variable         Space35,35,"                             
  1840.                 "
  1841.               18    Variable        Space76,76,"                              
  1842.                                                          "
  1843.               19    Variable        TotSpace,10
  1844.               20    Variable        AvailSpace,10
  1845.               21    Variable        Msg,78
  1846.               22    Variable        Msg2,78
  1847.               23    Variable        FName,35
  1848.               24    Variable        LName,35
  1849.               25    ?Color          Fore,Back,ColorAttr  ;initial color
  1850.               26    ?Date           DOW,Mo,Da,Yr         ;get system date
  1851.               27    ?Time           CurrTime             ;get system time
  1852.               28    Clear
  1853.               29      ReadYN             "Do  you have a  color monitor? [Y/N]
  1854.             ",CharIn
  1855.               30    Compare         CharIn,"Y",,,ColorMon
  1856.               31    SetVar          RedOnGray,112
  1857.               32    SetVar          YelOnBlue,7
  1858.               33    SetVar          BlueOnGray,7
  1859.               34    Label           ColorMon
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.             Page 35                     PowerBatch                     Page 35
  1868.  
  1869.               35    Clear           BlueOnGray           ;clear to my color
  1870.               36    Box1            2,10,79,25,YelOnGray ;info box border
  1871.               37    ClearBox        2,10,79,25,YelOnBlue ;     interior
  1872.               38    Color           RedOnGray
  1873.               39    Box1            24,1,56,5,RedOnGray  ;title box
  1874.               40    ClearBox        24,1,56,5,RedOnBlack
  1875.               41    Color           RedOnBlack
  1876.               42    Center          "POWERBATCH",2
  1877.               43    Center          "By",3
  1878.               44    Center          "Computing Systems Design, Inc.",4
  1879.               45    Color           YelOnBlue
  1880.               46    WriteAt         3,11,"PowerBatch is  a power batch utility
  1881.             that produces COMPILED batch files."
  1882.               47     WriteAt         3,12,"With PowerBatch you can perform all
  1883.             standard DOS batch functions, plus"
  1884.               48     WriteAt           3,13,"use the  35 additional PowerBatch
  1885.             commands to create batch files with POWER."
  1886.               49      WriteAt            3,15,"PowerBatch compiles  your batch
  1887.             commands and produces a standalone .EXE"
  1888.               50     WriteAt            3,16,"module that  executes at the top
  1889.             speed of your computer. This information"
  1890.               51    WriteAt           3,17,"and demonstration program  you are
  1891.             now running is a compiled PowerBatch"
  1892.               52     WriteAt           3,18,"program  (the included  source is
  1893.             DEMO1.PWR). PowerBatch is especially"
  1894.               53       WriteAt             3,19,"powerful  for screen  related
  1895.             functions. Draw boxes, write to the screen with"
  1896.               54     WriteAt         3,20,"blazing speed,  control text colors
  1897.             with ease, get input from the user, make"
  1898.               55       WriteAt             3,21,"data  comparisions and  logic
  1899.             branches, and access system information with"
  1900.               56     WriteAt          3,22,"single commands. Follow this  tour
  1901.             of the power in PowerBatch."
  1902.               57    GoToXY          26,24
  1903.               58    Write           "Press any key to continue...",RedOnGray
  1904.               59    ReadKey         CharIn
  1905.               60    ClearBox        2,10,79,25,YelOnBlue
  1906.               61     WriteAt          3,11,"PowerBatch gives you access to the
  1907.             system date and time and makes these"
  1908.               62    WriteAt         3,12,"available as variables for your  use
  1909.             in screen writes."
  1910.               63     WriteAt         3,14,"The system date is returned in four
  1911.             variables of your choice. In these"
  1912.               64    GoToXY          3,15
  1913.               65    Write           "variables are placed Day of the week ("
  1914.               66    Write           DOW
  1915.               67    Write           ") Month number ("
  1916.               68    Write           Mo
  1917.               69    Write           "),"
  1918.               70    GoToXY          3,16
  1919.               71    Write           "Day number ("
  1920.               72    Write           Da
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.             Page 36                     PowerBatch                     Page 36
  1929.  
  1930.               73    Write           "), and Year number ("
  1931.               74    Write           Yr
  1932.               75    Write           ")."
  1933.               76     WriteAt          3,18,"In a  like manner the current time
  1934.             may be retrieved into a variable of your"
  1935.               77    WriteAt         3,19,"choice, and used any way you wish."
  1936.               78    WriteAt         3,21,"Current time is "
  1937.               79    WriteAt         19,21,CurrTime
  1938.               80    GoToXY          26,24
  1939.               81    Color           YelOnBlue
  1940.               82    Blink
  1941.               83    Write           "Press any key to continue..."
  1942.               84    Normal
  1943.               85    ReadKey         CharIn
  1944.               86    ClearBox        2,10,79,25,YelOnBlue
  1945.               87    WriteAt           3,11,"PowerBatch also provides  you with
  1946.             several input commands to retrieve both"
  1947.               88     WriteAt           3,12,"data and question responses  from
  1948.             the user. Commands are provided to retrieve"
  1949.               89     WriteAt           3,13,"one  key (and one key only), read
  1950.             one key in upper case, read either Y or N"
  1951.               90    WriteAt          3,14,"for Yes/No responses, and to read a
  1952.             string of a specified length."
  1953.               91    GoToXY          3,15
  1954.               92    Write           "Enter one character in lower case [ ]"
  1955.               93    GoToXY          38,15
  1956.               94    ReadKey         CharIn
  1957.               95    GoToXY          41,15
  1958.               96    Write           "You can manipulate the case "
  1959.               97    GoToXY          3,16
  1960.               98    Write            "of the data entered changing from  lower
  1961.             ["
  1962.               99    Write           CharIn
  1963.              100    Write           "] to upper ["
  1964.              101    Upper           CharIn
  1965.              102    Write           CharIn
  1966.              103    Write           "] to lower ["
  1967.              104    Lower           CharIn
  1968.              105    Write           CharIn
  1969.              106    Write           "]."
  1970.              107     WriteAt            3,18,"PowerBatch also  contains strong
  1971.             string manipulation commands."
  1972.              108    WriteAt         3,19,"Enter your last name "
  1973.              109    ReadStr         LName
  1974.              110    WriteAt         14,19,Space35
  1975.              111    WriteAt         14,19,"first name "
  1976.              112    ReadStr         FName
  1977.              113    WriteAt         3,19,Space35
  1978.              114    Midstring       Msg,FName,1,3
  1979.              115    Midstring       Msg2,LName,1,3
  1980.              116    Concat          Msg," "
  1981.              117    Concat          Msg,Msg2
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.             Page 37                     PowerBatch                     Page 37
  1990.  
  1991.              118    WriteAt         3,20,Msg
  1992.              119    Wait            10
  1993.              120    Midstring       Msg,FName,1,6
  1994.              121    Midstring       Msg2,LName,1,6
  1995.              122    Concat          Msg," "
  1996.              123    Concat          Msg,Msg2
  1997.              124    WriteAt         3,20,Msg
  1998.              125    Wait            10
  1999.              126    Concat          Msg,FName," "
  2000.              127    Concat          Msg,LName
  2001.              128    WriteAt         3,20,Msg
  2002.              129    Length          Msg2,Msg
  2003.              130      Concat            Msg,"The length of  this name field is
  2004.             ",Msg2
  2005.              131    WriteAt         3,21,Msg
  2006.              132    GoToXY          26,24
  2007.              133    Write           "Press any key to continue...",RedOnGray
  2008.              134    ReadKey         CharIn
  2009.              135    ClearBox        2,10,79,25,YelOnBlue
  2010.              136    WriteAt          3,11,"PowerBatch gives you the capability
  2011.             to verify drives, directories, or file"
  2012.              137    WriteAt          3,12,"names entered by the user. You  may
  2013.             execute selected portions of the batch"
  2014.              138     WriteAt            3,13,"file based  on the existance  or
  2015.             non-existance of these entries."
  2016.              139    Label           ChekDrive
  2017.              140    GoToXY          3,15
  2018.              141    Write           "Enter a drive letter to be verified"
  2019.              142    Write           Space35
  2020.              143    GoToXY          39,15
  2021.              144    ReadUpKey       CharIn
  2022.              145    ?DriveExist     CharIn,GoodDrive
  2023.              146    Blink
  2024.              147     WriteAt           3,24,"That is not a valid drive in your
  2025.             system. Please re-enter."
  2026.              148    Normal
  2027.              149    Beep            750,8
  2028.              150    Wait            30
  2029.              151    WriteAt         3,24,Space76
  2030.              152    GoTo            ChekDrive
  2031.              153    Label           GoodDrive
  2032.              154    GoToXY          3,16
  2033.              155    Write           "Enter a directory name to be verified"
  2034.              156    Write           Space35
  2035.              157    GoToXY          41,16
  2036.              158    ReadStr         DirName
  2037.              159    ?DirExist       DirName,GoodDir
  2038.              160    Blink
  2039.              161    WriteAt           3,24,"That is not  a valid directory  in
  2040.             your system. Please re-enter."
  2041.              162    Normal
  2042.              163    Wait            30
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.             Page 38                     PowerBatch                     Page 38
  2051.  
  2052.              164    WriteAt         3,24,Space76
  2053.              165    GoTo            GoodDrive
  2054.              166    Label           GoodDir
  2055.              167    GoToXY          3,17
  2056.              168    Write           "Enter a file name to be verified"
  2057.              169    Write           Space35
  2058.              170    GoToXY          36,17
  2059.              171    ReadStr         FileName
  2060.              172    ?FileExist      FileName,GoodFile
  2061.              173    Blink
  2062.              174     WriteAt           3,24,"That is not  a valid filename  in
  2063.             your system. Please re-enter."
  2064.              175    Normal
  2065.              176    Wait            30
  2066.              177    WriteAt         3,24,Space76
  2067.              178    GoTo            GoodDir
  2068.              179    Label           GoodFile
  2069.              180    WriteAt          3,18,"PowerBatch can  query your disk for
  2070.             total space and available space"
  2071.              181     WriteAt            3,19,"Drive [  ] capacities are (enter
  2072.             drive letter)"
  2073.              182    GoToXy          10,19
  2074.              183    ReadUpKey       CharIn
  2075.              184    ?DiskSpace      CharIn,TotSpace,AvailSpace
  2076.              185    Concat          Msg,CharIn," has "
  2077.              186    Concat          Msg,AvailSpace
  2078.              187    Concat          Msg," bytes available of the total "
  2079.              188    Concat          Msg,TotSpace
  2080.              189    Concat          Msg," bytes"
  2081.              190    WriteAt         9,19,Msg
  2082.              191    GoToXY          26,24
  2083.              192    Write           "Press any key to continue...",RedOnGray
  2084.              193    ReadKey         CharIn
  2085.              194    Clear
  2086.              195     WriteLine       "PowerBatch can run any valid DOS command
  2087.             that may be inserted in a batch file."
  2088.              196     WriteLine        "For example, here is  a listing of your
  2089.             current directory..."
  2090.              197    Wait            30
  2091.              198    Clear           ColorAttr     ;clear to default color
  2092.              199    Dir             "/w"
  2093.              200    Wait            30
  2094.              201    Color           YelOnBlue
  2095.              202    Clear
  2096.              203     WriteLine          "PowerBatch can also run  (and return)
  2097.             other PowerBatch programs, giving you a "
  2098.              204       WriteLine          "subroutine  capability. It  has the
  2099.             capability to re-boot the system (which I"
  2100.              205    WriteLine       "will NOT demonstrate here."
  2101.              206    GoToXY          1,5
  2102.              207    WriteLine        "The purpose of  this demonstration is to
  2103.             not only show you the capabilities"
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.             Page 39                     PowerBatch                     Page 39
  2112.  
  2113.              208     WriteLine        "of  PowerBatch, but to let you  compare
  2114.             the source with the running version"
  2115.              209      WriteLine         "of this  program and  aid you  in the
  2116.             development of your own PowerBatch"
  2117.              210    WriteLine       "programs."
  2118.              211    GoToXY          1,10
  2119.              212    Write           "Press any key to continue..."
  2120.              213    ReadKey         CharIn
  2121.              214    Color           ColorAttr     ;reset original colors
  2122.              215    Clear
  2123.              216    Box1            24,1,56,5,ColorAttr
  2124.              217    Center          "POWERBATCH",2
  2125.              218    Center          "By",3
  2126.              219    Center          "Computing Systems Design, Inc.",4
  2127.              220    GoToXy          1,24
  2128.  
  2129.  
  2130.  
  2131.  
  2132.  
  2133.  
  2134.  
  2135.             Page 40                     PowerBatch                     Page 40
  2136.  
  2137.                                           MOVE1
  2138.  
  2139.             Variable        CLP%1,79,"a"          ;command line parm %1
  2140.             Variable        CLP%2,79,"a"          ;%2
  2141.             Variable        InChar,1              ;for keyboard responses
  2142.             Compare         CLP%1,"a",,,Syntax    ;show syntax
  2143.             Compare         CLP%2,"a",,,Syntax
  2144.             Clear                                 ;clear the screen
  2145.             Upper           CLP%1                 ;make CLP%1 upper case
  2146.             Upper           CLP%2                 ;make CLP%2 upper case
  2147.             Write           "Move "               ;build initial msg
  2148.             Write           CLP%1
  2149.             Write           " to "
  2150.             WriteLine       CLP%2
  2151.             ?FileExist      CLP%1,File1OK         ;does source file exist
  2152.             Write           CLP%1                 ;write error msg
  2153.             WriteLine       " not found."
  2154.             GoTo            BadCopy
  2155.             Label           File1OK
  2156.             ?FileExist         CLP%2,,File2OK          ;does  destination file
  2157.             exist
  2158.             Write           CLP%2                 ;write error msg
  2159.             WriteLine       " exists!"
  2160.             ReadYN          "Overwrite? [Y/N] ",InChar
  2161.             WriteLine       ""
  2162.             Compare         InChar,"N",,,BadCopy
  2163.             Label           File2OK
  2164.             Compare         CLP%1,CLP%2,,,DupFiles ;cannot copy to itself
  2165.             Copy            CLP%1 CLP%2            ;DOS copy command
  2166.             ?FileExist       CLP%2,,BadCopy          ;did  output file make it
  2167.             OK
  2168.             Write           "Erasing "             ;tell user erasing source
  2169.             WriteLine       CLP%1
  2170.             Erase           CLP%1                  ;DOS erase command
  2171.             WriteLine       "Move successful"      ;msg to user
  2172.             Halt
  2173.             Label           DupFiles
  2174.             WriteLine       "Cannot move a file to itself"
  2175.             Label            BadCopy                   ;unsuccessful comes  to
  2176.             here
  2177.             WriteLine       "Move unsuccessful"
  2178.             Halt
  2179.             Label           Syntax
  2180.             WriteLine       "Syntax is Move1 SourceFileName TargetFileName"
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.             Page 41                     PowerBatch                     Page 41
  2189.  
  2190.                                           MOVE2
  2191.  
  2192.             Variable        CLP%1,79,"a"           ;command line parm %1
  2193.             Variable        CLP%2,79,"a"           ;%2
  2194.             Variable        InChar,1               ;for keyboard responses
  2195.             Compare         CLP%1,"a",,,Syntax     ;show syntax
  2196.             Compare         CLP%2,"a",,,Syntax
  2197.             Clear                                  ;clear the screen
  2198.             Upper           CLP%1                  ;make CLP%1 upper case
  2199.             Upper           CLP%2                  ;make CLP%2 upper case
  2200.             Write           "Move "                ;build initial msg
  2201.             Write           CLP%1
  2202.             Write           " to "
  2203.             WriteLine       CLP%2
  2204.             Label           ChkFile1
  2205.             ?FileExist      CLP%1,File1OK          ;does source file exist
  2206.             Blink                                     ;if not make screen text
  2207.             blink
  2208.             Write           CLP%1                  ;write error msg
  2209.             WriteLine       " not found."
  2210.             Normal                                 ;set text to normal
  2211.             Write           "Enter source file name : " ;prompt user for name
  2212.             ReadStr         CLP%1
  2213.             GoTo            ChkFile1
  2214.             Label           File1OK                ;check new name for exists
  2215.             ?FileExist        CLP%2,,File2OK           ;does  destination file
  2216.             exist
  2217.             Blink                                  ;if not then text to blink
  2218.             Write           CLP%2                  ;write error message
  2219.             WriteLine       " exists!"
  2220.             Normal                                 ;set text to normal
  2221.             ReadYN          "Overwrite? [Y/N] ",InChar      ;query user
  2222.             WriteLine       ""
  2223.             Compare         InChar,"N",,,BadCopy   ;if user entered "Y"  exit
  2224.             Label           File2OK                ;come here if all OK
  2225.             Compare         CLP%1,CLP%2,,,DupFiles ;cannot copy to itself
  2226.             Copy            CLP%1 CLP%2            ;DOS copy command
  2227.             ?FileExist      CLP%2,,BadCopy         ;is output file OK
  2228.             Reverse                                ;make text reverse video
  2229.             Write           "Erasing "             ;write erase message
  2230.             WriteLine       CLP%1
  2231.             Normal                                 ;set text back to normal
  2232.             Erase           CLP%1                  ;DOS erase command
  2233.             WriteLine       "Move successful"      ;tell user all is OK
  2234.             Halt
  2235.             Label           DupFiles
  2236.             WriteLine       "Cannot move a file to itself"
  2237.             Label           BadCopy
  2238.             WriteLine       "Move unsuccessful"
  2239.             Label           Syntax
  2240.             WriteLine       "Syntax is Move1 SourceFileName TargetFileName"
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.             Page 42                     PowerBatch                     Page 42
  2249.  
  2250.                                           MENU1
  2251.  
  2252.             Variable        FColor,1                 ;store the current screen
  2253.             colors
  2254.             Variable      BColor,1
  2255.             Variable      ColorAttr,1
  2256.             Variable      MenuSel,1
  2257.             ?Color        FColor,BColor,ColorAttr
  2258.             Label         ShowMenu
  2259.             Clear         112                  ;clear screen to a new color
  2260.             Center        "Demonstration Menu",2    ;center on line 2
  2261.             WriteAt       10,4,"A. Run a directory and return"
  2262.             WriteAt           10,6,"B.  Run BoxDemo  and return  (DOS batch  +
  2263.             PowerBatch + return)"
  2264.             WriteAt       10,8,"C. Reboot your system"
  2265.             WriteAt       10,10,"E. Exit this menu and return to DOS"
  2266.             Label         GetInp
  2267.             WriteAt       15,13,"Enter your choice :"
  2268.             GoToXY        34,13
  2269.             ReadUpKey     MenuSel                   ;get users selection
  2270.             Compare       MenuSel,"A",ChekB,Error   ;compare selection to A
  2271.             Clear          7,0                   ;clear screen to fore 7, back
  2272.             0
  2273.             dir           "/w"                 ;run DOS dir cmd with /w parm
  2274.             Wait          30                        ;wait 3 secs for show
  2275.             GoTo          ShowMenu                  ;redisplay menu
  2276.             Label         ChekB
  2277.             Compare       MenuSel,"B",ChekC,Error   ;compare selection to B
  2278.             Clear         15                   ;clear screen to attribute 15
  2279.             DOSEX1                                  ;run a DOS  batch file   &
  2280.             PowerBatch program
  2281.             Wait          30                   ;wait 3 secs
  2282.             GoTo          ShowMenu             ;redisplay menu
  2283.             Label         ChekC
  2284.             Compare       MenuSel,"C",ChekE,Error   ;compare selection to C
  2285.             Boot                                    ;perform a warm boot
  2286.             Label         ChekE
  2287.             Compare       MenuSel,"E",Error,Error   ;compare selection to E
  2288.             Clear         ColorAttr                 ;restore original color
  2289.             Halt                                           ;end the PowerBatch
  2290.             program
  2291.             Label         Error                     ;come here for errors
  2292.             Blink                                   ;reverse the colors
  2293.             WriteAt       5,20,"InCorrect menu selection...Try again."
  2294.             Beep          750,5                ;beep at 750 hz for half sec
  2295.             Wait          30                        ;wait 3 secs to see msg
  2296.             Normal                                  ;restore text attributes
  2297.             ClearLine     20                        ;clear the message line
  2298.             GoToXY        34,13                     ;erase the wrong entry
  2299.             Write         " "
  2300.             GoTo          GetInp                    ;get new menu selection
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.             Page 43                     PowerBatch                     Page 43
  2309.  
  2310.                                          BOXDEMO2
  2311.  
  2312.             Variable    FColor,1
  2313.             Variable    BColor,1
  2314.             Variable    ColorAttr,1
  2315.             Variable    Clr1,3,30
  2316.             Variable    Clr2,3,46
  2317.             Variable    Clr3,3,62
  2318.             Variable    Clr4,3,78
  2319.             Variable    Clr5,3,94
  2320.             Variable    Clr6,3,110
  2321.             Variable    InChar,1
  2322.             ?Color      FColor,BColor,ColorAttr           ;save curr colors
  2323.             Clear       Clr1                         ;clear screen to color 1
  2324.             Label       MonType
  2325.             GoToXY      1,20
  2326.             ReadYN      "Do you have a color monitor? [Y/N] ",InChar
  2327.             Compare     InChar,"N",ColorsOK
  2328.             SetVar      Clr1,7                       ;reset colors for mono
  2329.             SetVar      Clr2,112
  2330.             SetVar      Clr3,112
  2331.             SetVar      Clr4,112
  2332.             SetVar      Clr5,112
  2333.             SetVar      Clr6,112
  2334.             Label       ColorsOK
  2335.             Clear       Clr1                              ;clear screen
  2336.             Box1         15,7,66,18,Clr1               ;draw center box, color
  2337.             1
  2338.             WriteAt         16,8,"Drawing  boxes  (or  frames)  around  screen
  2339.             displays"
  2340.             WriteAt         17,9,"seems  to add  a  finishing touch  to menus,
  2341.             messages"
  2342.             WriteAt        17,10,"or  any other  information  conveyed to  the
  2343.             user."
  2344.             WriteAt        16,12,"With  a  batch file,  not  only is  it  time
  2345.             consuming,"
  2346.             WriteAt         17,13,"but  painfully slow.  Most  of the  time it
  2347.             simply"
  2348.             WriteAt     17,14,"is not worth the trouble."
  2349.             WriteAt     16,16,"With PowerBatch, you draw your frame with one"
  2350.             WriteAt     17,17,"command. And it is a little faster..."
  2351.             Box1        2,1,14,6,Clr1                ;draw boxes around perif
  2352.             Box1        2,7,14,12,Clr1
  2353.             Box1        2,13,14,18,Clr1
  2354.             Box1        2,19,14,24,Clr1
  2355.             Box1        15,19,27,24,Clr1
  2356.             Box1        28,19,40,24,Clr1
  2357.             Box1        41,19,53,24,Clr1
  2358.             Box1        54,19,66,24,Clr1
  2359.             Box1        67,19,79,24,Clr1
  2360.             Box1        67,13,79,18,Clr1
  2361.             Box1        67,7,79,12,Clr1
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.             Page 44                     PowerBatch                     Page 44
  2370.  
  2371.             Box1        67,1,79,6,Clr1
  2372.             Box1        54,1,66,6,Clr1
  2373.             Box1        41,1,53,6,Clr1
  2374.             Box1        28,1,40,6,Clr1
  2375.             Box1        15,1,27,6,Clr1
  2376.             wait        30                                  ;wait 3 secs
  2377.             ClearBox    2,1,14,6,Clr6             ;clear boxes to diff colors
  2378.             ClearBox    2,7,14,12,Clr2
  2379.             ClearBox    2,13,14,18,Clr3
  2380.             ClearBox    2,19,14,24,Clr4
  2381.             ClearBox    15,19,27,24,Clr5
  2382.             ClearBox    28,19,40,24,Clr6
  2383.             ClearBox    41,19,53,24,Clr2
  2384.             ClearBox    54,19,66,24,Clr3
  2385.             ClearBox    67,19,79,24,Clr4
  2386.             ClearBox    67,13,79,18,Clr5
  2387.             ClearBox    67,7,79,12,Clr6
  2388.             ClearBox    67,1,79,6,Clr2
  2389.             ClearBox    54,1,66,6,Clr3
  2390.             ClearBox    41,1,53,6,Clr4
  2391.             ClearBox    28,1,40,6,Clr5
  2392.             ClearBox    15,1,27,6,Clr6
  2393.             Wait        30
  2394.             ClearBox    28,19,40,24,Clr1
  2395.             ClearBox    28,1,40,6,Clr1
  2396.             ClearBox    2,19,14,24,Clr1
  2397.             ClearBox    54,1,66,6,Clr1
  2398.             ClearBox    67,1,79,6,Clr1
  2399.             ClearBox    67,7,79,12,Clr1
  2400.             ClearBox    67,13,79,18,Clr1
  2401.             ClearBox    67,19,79,24,Clr1
  2402.             ClearBox    54,19,66,24,Clr1
  2403.             ClearBox    15,19,27,24,Clr1
  2404.             ClearBox    15,1,27,6,Clr1
  2405.             ClearBox    2,13,14,18,Clr1
  2406.             ClearBox    2,7,14,12,Clr1
  2407.             ClearBox    41,1,53,6,Clr1
  2408.             ClearBox    41,19,53,24,Clr1
  2409.             ClearBox     2,1,14,6,Clr1                   ;clear boxes  to diff
  2410.             colors
  2411.             WriteAt     1,25,"Press any key to exit"
  2412.             GoToXY      23,25                      ;position cursor after msg
  2413.             ReadKey      InChar                        ;wait for user to press
  2414.             key
  2415.             Clear         ColorAttr                      ;clear screen to orig
  2416.             color
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.             Page 45                     PowerBatch                     Page 45
  2425.  
  2426.                                           Index
  2427.  
  2428.      ASP  1                                    ?INPATH  18
  2429.      Box  19                                   ?TIME  18
  2430.      Case                                      BEEP  18
  2431.            lower  24                           BLINK  19
  2432.            upper  25, 27                       BOX  19
  2433.      Color attribute  15, 25                   BREAKOFF  20
  2434.      Command line parameters  27               BREAKON  20
  2435.      Command Summary  30                       CENTER  20
  2436.      Command Syntax  15                        CLEAR  20
  2437.      Comments  10                              CLEARBOX  20
  2438.      Compare                                   CLEARLINE  21
  2439.            alphabetic  22                      COLOR  21
  2440.            numeric  22                         COMPARE  22
  2441.      Compilation Errors  31                    CONCAT  23
  2442.      Concatenate  23                           GOTO  23
  2443.      Concept Of Operation  5                   GOTOXY  23
  2444.      Copyright  1                              HALT  24
  2445.      Ctrl - Break  20                          LABEL  24
  2446.      Current date  16                          LENGTH  24
  2447.      Current time  18                          LOWER  24
  2448.      Cursor  23                                MIDSTRING  24
  2449.      Directory  16                             NORMAL  25
  2450.      Disk capacity  17                         READKEY  25
  2451.      Disk free space  17                       READSTR  25
  2452.      DOS errorlevel  24                        READUPKEY  25
  2453.      DOS search path  18                       READYN  26
  2454.      DOSERROR  11, 13                          REVERSE  26
  2455.      Environment variable  17                  SETVAR  26
  2456.      ERRORLEVEL  11, 13, 24                    UPPER  27
  2457.      External command  13, 32                  VARIABLE  27
  2458.      Field length                              WAIT  27
  2459.            maximum  25, 27                     WRITE  28
  2460.      File exists  18                           WRITEAT  28
  2461.      Frame  19                                 WRITELINE  28
  2462.      Installation  7                        POWERMAK  9
  2463.      Interior of a box  21                  Registration  1
  2464.      Introduction  1                        Registration Fees  3
  2465.      Line numbers  34                       Removing PowerBatch From Your
  2466.      Literals  10, 11                             System  33
  2467.      Pause  27                              Screen clear  20
  2468.      POWERBAT.ERR  31                       Shareware  1
  2469.      PowerBatch Commands  10                Software Support  4
  2470.            ?COLOR  15                       String length  24
  2471.            ?CURRDIR  15                     Substring  24
  2472.            ?DATE  15                        System speaker  18
  2473.            ?DIREXIST  16                    Valid drive  17
  2474.            ?DISKSPACE  17                   Value
  2475.            ?DRIVEEXIST  17                     initial  27
  2476.            ?ENVSTR  17                      Variable  10
  2477.            ?FILEEXIST  18                      value  26
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.             Page 46                     PowerBatch                     Page 46
  2486.  
  2487.      Variable map  9
  2488.      Warranty  2
  2489.      What You Get  3
  2490.  
  2491.